time to put on your thinking hats
DESCRIPTION
Time to Put on your thinking Hats. What would be the output. void main() { int a=32767; printf(“%d”, a); }. 32767. What would be the output. void main() { int a=32769; printf(“%d”, a); }. -32767. What would be the output. void main() { int a=1232.5; printf(“%d”, a); }. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/1.jpg)
![Page 2: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/2.jpg)
void main(){int a=32767;printf(“%d”, a);
}
![Page 3: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/3.jpg)
void main(){int a=32769;printf(“%d”, a);
}
![Page 4: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/4.jpg)
void main(){int a=1232.5;printf(“%d”, a);
}
![Page 5: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/5.jpg)
void main(){int a=-32779.205;printf(“%d”, a);
}
![Page 6: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/6.jpg)
void main(){
float a=-3279.205;printf(“%d”, a);
}
![Page 7: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/7.jpg)
void main(){
int a=-3279.205;printf(“%f”, a);
}
![Page 8: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/8.jpg)
void main(){
float a=-32779.205;printf(“%f”, a);
}
![Page 9: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/9.jpg)
void main(){
float a=-32779.205;printf(“%.1f”, a);
}
![Page 10: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/10.jpg)
void main(){float a=69;printf(“%f”, a);
}
![Page 11: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/11.jpg)
void main(){int a,b,c;a=5;b=2;c=a/b;printf(“%d”, c);
}
![Page 12: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/12.jpg)
void main(){
int a,b;float c;a=5;b=2;c=a/b;printf(“%f”, c);
}
![Page 13: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/13.jpg)
void main(){float a,b,c;a=5;b=2;c=a/b;printf(“%f”, c);
}
![Page 14: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/14.jpg)
void main(){
int a,b;float c;a=5;b=2;c=(float)a/b;printf(“%f”, c);
}
![Page 15: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/15.jpg)
void main(){
char s=65;char ch=‘A’;char st=‘25’;printf(“%d”,ch);printf(“%c”,ch);printf(“%d”,s);printf(“%c”,s);printf(“%c”,st);printf(“%d”,st);
}
![Page 16: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/16.jpg)
![Page 17: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/17.jpg)
Try some of these:
printf(“%d”,-100);
printf(“%.2f”,128);
printf(“%f”,-130);
printf(“%c”,91);
printf(“%d”,34342);
printf(“%x”,1004);
printf(“%x”,16);
![Page 18: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/18.jpg)
#include<stdio.h>void main(){printf("%d",5+3*6/2-5);}
9
![Page 19: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/19.jpg)
void main(){printf(“%d”, printf(“vita”));
}
![Page 20: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/20.jpg)
![Page 21: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/21.jpg)
void main(){
char s=5;s++;printf(“%d”,s);printf(“%d”,s++);printf(“%d”,s);printf(“%d”,++s);printf(“%d”,s);
}
![Page 22: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/22.jpg)
void main(){
int s=5;s++;printf(“%d”,s);printf(“%d”,s--);printf(“%d”,s);printf(“%d”,--s);printf(“%d”,s);
}
![Page 23: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/23.jpg)
printf(“%d”, s++s); printf(“%d”, s++++s); printf(“%d”, s+++++s); printf(“%d”, s++ + ++s); printf(“%d”,++s+++s); printf(“%d”,++s+++s+
+); printf(“%d”, s+s++); printf(“%d”, s+s++++);
![Page 24: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/24.jpg)
void main(){
char s=5;printf(“%d%d%d%d”,++s,++s,s++,++s);printf(“\n%d”,s);
}
![Page 25: Time to Put on your thinking Hats](https://reader036.vdocuments.us/reader036/viewer/2022081603/56813f4e550346895daa077f/html5/thumbnails/25.jpg)
Bitwise Operators3^2&~1