void main int a32767 printfd a Compiled By




































- Slides: 36


void main() { int a=32767; printf(“%d”, a); } Compiled By Nidhi Poddar @ VITA 2

void main() { int a=32769; printf(“%d”, a); } Compiled By Nidhi Poddar @ VITA 3

void main() { int a=1232. 5; printf(“%d”, a); } Compiled By Nidhi Poddar @ VITA 4

void main() { int a=-32779. 205; printf(“%d”, a); } Compiled By Nidhi Poddar @ VITA 5

void main() { float a=-3279. 205; printf(“%d”, a); } Compiled By Nidhi Poddar @ VITA 6

void main() { int a=-3279. 205; printf(“%f”, a); } Compiled By Nidhi Poddar @ VITA 7

void main() { float a=-32779. 205; printf(“%f”, a); } Compiled By Nidhi Poddar @ VITA 8

void main() { float a=-32779. 205; printf(“%. 1 f”, a); } Compiled By Nidhi Poddar @ VITA 9

void main() { float a=69; printf(“%f”, a); } Compiled By Nidhi Poddar @ VITA 10

void main() { int a, b, c; a=5; b=2; c=a/b; printf(“%d”, c); } Compiled By Nidhi Poddar @ VITA 11

void main() { int a, b; float c; a=5; b=2; c=a/b; printf(“%f”, c); } Compiled By Nidhi Poddar @ VITA 12

void main() { float a, b, c; a=5; b=2; c=a/b; printf(“%f”, c); } Compiled By Nidhi Poddar @ VITA 13

void main() { int a, b; float c; a=5; b=2; c=(float)a/b; printf(“%f”, c); } Compiled By Nidhi Poddar @ VITA 14

�A-Z 65 -90 �a-z 97 -122 � 0 -9 48 -57 �Special symbols: 0 -47 58 -64 91 -96 123 -254 Compiled By Nidhi Poddar @ VITA 15

void main() { char s=65; char ch=‘A’; char st=‘ 25’; printf(“%d”, ch); 65 printf(“%c”, ch); A printf(“%d”, s); 65 printf(“%c”, s); A printf(“%c”, st); 2 printf(“%d”, st); 50 } Compiled By Nidhi Poddar @ VITA 16

� Try some of these: printf(“%c”, -100); £ printf(“%c”, -128); Ç printf(“%c”, -130); ~ printf(“%c”, 100); d printf(“%d”, -10); -10 printf(“%x”, 1>>4); ffff printf(“%x”, 16); 10 Compiled By Nidhi Poddar @ VITA 17

� Try some of these: printf(“%d”, -100); printf(“%. 2 f”, 128); printf(“%f”, -130); printf(“%c”, 91); printf(“%d”, 34342); printf(“%x”, 1004); printf(“%x”, 16); Compiled By Nidhi Poddar @ VITA 18

#include<stdio. h> void main() { printf("%d", 5+3*6/2 -5); } 9 5+18/2 -5 // division has higher precedence then + and 5+9 -5 //+ , - has same precedence so check associativity ie. L to r 9 Compiled By Nidhi Poddar @ VITA 19

void main() { int a, b, c; a=5; b=2; c=a; a=b; b=c; printf(“%d, %d”, a, b); } Compiled By Nidhi Poddar @ VITA 21

� Suppose we print c over here what would be its value? 5, as it copy paste the value and does not cut paste the values Compiled By Nidhi Poddar @ VITA 22

void main() { int a, b; a=5; b=2; a=a+b; b=a-b; a=a-b; printf(“%d, %d”, a, b); } Compiled By Nidhi Poddar @ VITA 23

void main() { int a, b; a=5; b=2; a=a*b; ? =a/b; printf(n“%d, %d”, a, b); } Compiled By Nidhi Poddar @ VITA 24

void main() { int a, b; a=5; b=2; a=a^b; b=a^b; a=a^b; printf(“n%d, %d”, a, b); } Compiled By Nidhi Poddar @ VITA 25

� a=5 � b=6 � a^b=3 � a=3 � b=6 � a^b=5 � a=3 � b=5 � a^b=6 Compiled By Nidhi Poddar @ VITA 101 110 011 110 101 011 101 110 26

b = (a*a)/a + (a=b) - a; a^=b^=a^=b; 27

28

29

void main() { char s=5; s++; printf(“%d”, s); printf(“%d”, s++); printf(“%d”, s); printf(“%d”, ++s); printf(“%d”, s); 6 6 7 8 8 } Compiled By Nidhi Poddar @ VITA 30

void main() { int s=5; s++; printf(“%d”, s); printf(“%d”, s--); printf(“%d”, s); printf(“%d”, --s); printf(“%d”, s); 6 6 5 4 4 } Compiled By Nidhi Poddar @ VITA 31

void main() { char s=5; printf(“%d”, s+++s); } 5+6= 11 What would the compiler read it as? a++ +a Or a+ ++a Note: Post increment has higher precedence than pre increment Compiled By Nidhi Poddar @ VITA 32

�printf(“%d”, s++s); �printf(“%d”, s+++++s); �printf(“%d”, s++ + ++s); �printf(“%d”, ++s+++s++); �printf(“%d”, s+s++++); Compiled By Nidhi Poddar @ VITA 33

void main() { char s=5; printf(“%d%d”, ++s, s++, ++s); printf(“n%d”, s); } 9866 9 Note: Post increment has higher precedence than pre increment, but here associativety is Right to Left Compiled By Nidhi Poddar @ VITA 34

� 1 km=1000 m � 1 m=100 cm � I inch=2. 54 cm � 1 feet=12 inch Compiled By Nidhi Poddar @ VITA 35

Bitwise Operators 3^2&~1 11 ^ 10 & ~ 01 11 ^ 10 & 10 11 ^ 10 01 1 Compiled By Nidhi Poddar @ VITA 36

Best of Luck 37
void main int a32767 printfd a void main
stack void testint int int main int A
22 void main short ab a32767 ba1 printfddab
int count8 int ptcount ptcount ptcount count printfd
class Tdate public void Tdate int int void
void polygonint a int b int c int
void mulint a int b int c int
2 stringarray 1 c void main void int
CLASS 5 int myabsint int rectint int int
void main int i int ar 157 3
void main int i0 int a100 for i0
indent void main int i int j i
int main void 0 bit num 5 int
void prteint b main int i int a10
void inordertreepointer ptr if ptr inorderptrlchild printfd ptrdata
include stdio h int main int i int
int main int x 2 int y x
include stdio h int main int x int
void insert First node ptrhead int input void
C overload swap void swapint int void swapdouble
int 5 int 2 main def main def
01 6 swap void swap int A int
int alpha0 void calibrate int center130 right90 left180
int inkazu 40 void keisan int keikazu 30
1 void Xint lines int static blank int
include stdio h void bar int len int
public void draw Rectint x int y int
7 2 C void select int data int
include stdio h int stack100 int top0 void
void combine 4vecptr v int dest int i
include stdio h int stack100 int top0 void
class Employee int salary int bonus public void
int arr10000 void Binky int i for i0
void fint n int j 0 for int
unionfind int parentMAXVERTICES int numMAXVERTICES void setinitint n
Procedural struct Human int height int age void