Docsity

C programming 1 marker objective type questions, Cheat Sheet of C programming

Toggle sidebar
bg1
C programming imp Points
1) Modulo operator always used between integers.
2)
int * float = float
float * float = float
float * int = float
always takes the size of bigger function.
3) Explicit Type Casting
int a = (int) 1.9999989 ;
output: int a = 1
4) Precedence :
multiply,divide,modulo
add, subtract
assignment(=)
#left to right if priority is same.(Associativity)
#terminate aka (;)
5) Control Instruction: used for determine flow of program
sequence, decision, loop, case controls.
6) True value can be given by natural numbers. (1,2, 3...)
False value can be given by 0.
pf2

Partial preview of the text

Download C programming 1 marker objective type questions and more Cheat Sheet C programming in PDF only on Docsity!

C programming imp Points

  1. Modulo operator always used between integers.

int * float = float float * float = float float * int = float always takes the size of bigger function.

  1. Explicit Type Casting int a = (int) 1.9999989 ; output: int a = 1
  2. Precedence : multiply,divide,modulo add, subtract assignment(=) #left to right if priority is same.(Associativity) #terminate aka (;)
  3. Control Instruction : used for determine flow of program sequence, decision, loop, case controls.
  4. True value can be given by natural numbers. (1,2, 3...) False value can be given by 0.
  1. Logical Operator && - and || - or | - not
  2. Precedence Of Operator : ! (not operator)
  • / %

<> <= >= == != && || =

  1. a=a+b <=> a+=b a=ab <=> a=b
  2. conditional operator  Ternary  Condition? (doSomething if true) : (doSomething if false ); Example : int age = 6; age >=18? printf(ā€œAdultā€) : printf(ā€œMinorā€);