25

Time to Put on your thinking Hats

  • Upload
    oriel

  • View
    31

  • Download
    0

Embed Size (px)

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 Presentation

Citation preview

Page 1: Time to Put on your  thinking Hats
Page 2: Time to Put on your  thinking Hats

void main(){int a=32767;printf(“%d”, a);

}

Page 3: Time to Put on your  thinking Hats

void main(){int a=32769;printf(“%d”, a);

}

Page 4: Time to Put on your  thinking Hats

void main(){int a=1232.5;printf(“%d”, a);

}

Page 5: Time to Put on your  thinking Hats

void main(){int a=-32779.205;printf(“%d”, a);

}

Page 6: Time to Put on your  thinking Hats

void main(){

float a=-3279.205;printf(“%d”, a);

}

Page 7: Time to Put on your  thinking Hats

void main(){

int a=-3279.205;printf(“%f”, a);

}

Page 8: Time to Put on your  thinking Hats

void main(){

float a=-32779.205;printf(“%f”, a);

}

Page 9: Time to Put on your  thinking Hats

void main(){

float a=-32779.205;printf(“%.1f”, a);

}

Page 10: Time to Put on your  thinking Hats

void main(){float a=69;printf(“%f”, a);

}

Page 11: Time to Put on your  thinking Hats

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

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

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

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

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
Page 17: Time to Put on your  thinking Hats

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

#include<stdio.h>void main(){printf("%d",5+3*6/2-5);}

9

Page 19: Time to Put on your  thinking Hats

void main(){printf(“%d”, printf(“vita”));

}

Page 20: Time to Put on your  thinking Hats
Page 21: Time to Put on your  thinking Hats

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

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

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

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

Bitwise Operators3^2&~1