Friday, 19 October 2012

C programming Quiz 5-10

C programming Quiz 5-10

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

Quiz 6:

#include

int main ()
{
printf("cba\b\b\b");
return 0;
}



Quiz 7:

‎#include
int main()
{
int a,b,c;
a=b=c=10;
c*=b=a*a;
printf("%d %d %d",a,b,c);
}



Quiz 8:
int main ()
{
int a=10;
printf("a-%d\n",a);
{
int a=100;
printf("a=%d\n",a);
a+=100;
}
printf("a=%d\n",a);
return 0;
}



Quiz 9:
void main()
{
int a;
long b;
float c;
double d;
a = b = c = d = 9/2;
printf("%d %ld %f %f",a,b,c,d);
a=b=c=d=9.0/2;
printf("%d %ld %f %f",a,b,c,d);
d=c=b=a=9.0/2;
printf("%d %ld %f %f",a,b,c,d);
}



Quiz 10:

main()
{
int a[][3]={1,2,3,4,5,6};
int (*ptr)[3]=a;
printf("%d %d",(*ptr)[1],(*ptr)[2]);
++ptr;
printf("%d %d",(*ptr)[1],(*ptr)[2]);
}


<--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