Friday, 19 October 2012

C programming Quiz 10-15

C programming Quiz 10-15

<--Previous                                  Page number: 1,2,3                                                          Next-->

Quiz 10:


main()
{
int j,ans;
j = 4;
ans = count(4);
printf("ans=%d\n",ans);
}
int count(int i)
{
if ( i < 0) return(i);
else
return( count(i-2) + count(i-1));
}



Quiz 11:

‎‎#include
int main()
{
int a=3, b = 5;
printf(&a["hi!Hello! how is this? %s\n"], &b["junk/super"]);
printf(&a["WHAT%c%c%c %c%c %c !\n"], 1["this"],2["beauty"],0["tool"],0["is"],3["sensitive"],4["CCCCCC"]);
return 0;
}


Quiz 13:
int main(){
int num,a=15;
num=- - - -a--;
printf("%d , %d",num,a);
return 0;}



Quiz 14:
int main(){
int x,i=2;
x=~-!++i;
printf("%d",x);
return 0;}



Quiz 15:

main()
{
char a =0xAA ;
int b ;
b = (int) a ;
b = b >> 4 ;
printf("%x",b);
}

<--Previous                                        Page number: 1,2,3                                                          Next-->

In case of any explanation kindly comment!

DON'T FORGET TO JOIN THIS BLOG.. SHARE IT WITH YOUR FRIEND!

No comments:

Post a Comment