Wednesday, 31 October 2012

C programming Quiz 31-35

C programming Quiz 31-35


Quiz 31:
main()
{
static int x=190;
static int y=x;
if(x==y)
printf("equal");
else
printf("unequal");
return 0;
}




Quiz 32:
int increment(int i)
{
i++;
return i;
}
int main()
{
int i;
for(i=0;i<10;increment(i)) printf("%d",i); getch(); }



Quiz 33:
What are the total number of keywords in C?

30
33
32
35



Quiz 34:
What is the output of following program? Assume that stack grows towards lower addresses. Also assume that variables are pushed on to the stack in the order in which they are declared.

main()
{
int x, y;
int *p1 = &x;
int *p2 = &y;
printf("%d\n", p1-p2);
}




Quiz 35:

main()
{
int x = 10;
int y = 20;
if (x <= y == 1) { ++x; } printf("%d\n", x); }


In case of any explanation kindly comment! DON'T FORGET TO JOIN THIS BLOG.. SHARE IT WITH YOUR FRIEND!

Daily quiz no.- 01

Daily quiz no-01

What would be the result??


Comment your answer without watching others comments first! You may explain your answer
Share it with your friend to see what's there answer!



Sunday, 28 October 2012

C programming Quiz 26-30

C programming Quiz 5-10

Quiz 26:
int main()
{
static char s[]="Hai Do It";
int i=0;
char ch;
ch=s[++i];
printf("%c\n",ch);
ch=s[i++];
printf("%c\n",ch);
ch=i++[s];
printf("%c\n",ch);
ch=++i[s];
printf("%c\n",ch);
}



Quiz 27:
main()
{
int c=5;
printf("%d",main||c);
getch();
}


Quiz 28:
main()
{
printf("%d, %d", sizeof("c"), sizeof(100));
}



Quiz 29:
int main()
{
int i = 6;
if( ((++i < 7) && ( i++/6)) || (++i <= 9))
;
printf("%d\n",i);
return 0;
}




Quiz 30:
 int main()
{
 int cnt = 5, a;
do
{
 a /= cnt;
 
}
 while (cnt --);
 printf ("%d\n", a);
 return 0;
 }


In case of any explanation kindly comment! DON'T FORGET TO JOIN THIS BLOG.. SHARE IT WITH YOUR FRIEND!

Wednesday, 24 October 2012

C programming Quiz 21-25

C programming Quiz 21-25

Quiz 21:
int a=1;
printf("%d %d %d", a, ++a, a++);


Quiz 22:
int main()
{

for(putchar('M');putchar('I');putchar('U'))
{
putchar('L');
}
}


Quiz 23:
int main()
{
printf("%d",'+'-'+'-'/'/'/'*'*'/'*');
}


Quiz 24:


int main(){
int i;
for(i = 0; i < 100; i++); { i++ printf("%d", i); }


Quiz 25:
int main()
{
int num=5;
switch(num)
{
default:printf("FACEBOOK\n");
case 1:printf("GOOGLE\n");break;
case 2:printf("GMAIL\n");break;
case 3:printf("ANDROID\n");break;
}
}




In case of any explanation kindly comment! DON'T FORGET TO JOIN THIS BLOG.. SHARE IT WITH YOUR FRIEND!

C programming Quiz 16-20

C programming Quiz 16-20



Quiz 16:
main()
{
float a = 0.7;
if (a < 0.7) printf ("C"); else printf("C++"); }



Quiz 17:
main()
{
char near * near *ptr1;
char near * far *ptr2;
char near * huge *ptr3;
printf("%d %d %d",sizeof(ptr1),sizeof(ptr2),sizeof(ptr3));
}


Quiz 18:
main( ) {
int z = 4;
printf( “%d”, printf(“ %d %d “, z, z)); }


Quiz 9:
int main()
{
int x,a=2;
x=++a,++a,a++;
printf("%d %d",x,a);
return 0;
}



Quiz 20:
program1::
main()
{int i=4,x;
x=++i + ++i + ++i;
printf("%d",x);
}

program2::
main()
{
int i=4;
printf("%d",++i + ++i + ++i);
}



In case of any explanation kindly comment!

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

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!

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!

C programming Quiz 1-5

C programming Quiz 1-5

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

#include
int main(){
int arr[]={6,12,18,24};
int x=0;
x=arr[1]+(arr[1]=2);
printf("x=%d",x);
return 0;



Quiz 2:

int main(){
int x,a=2;
x=++a,++a,a++;
printf("x=%d,a=%d",x,a);
return 0;
}



Quiz 3:
int main()
{
int p=-2,q=0,r=0,s;
clrscr();
s=++p || ++q && ++r;
printf("p=d, q=%d, r=%d, s=%d",p,q,r,s);
getch();
return 0;
}



Quiz 4:
main ()
{
unsigned int i;

for (i = 10; i >= 0; i--)
printf ("%d", i);
}
Options:
a) prints numbers 10 - 0
b) prints nos 10 - 1
c) goes into infinite loop




Quiz 5:

int main()
{
int a=-1,b=0,c=0,d=-1,res;
res=++a || b++ && c++ || ++d;
printf("a=%d,b=%d,c=%d,d=%d,res=%d",a,b,c,d,res);
return 0;
}


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

In case of any explanation kindly comment!

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

C Programming Quiz

Lets have a programming quiz to know how much you know about programming language!
Brush up your skills of programming here!

As This is the initial stage so we are only doing with C Programming language! We are uploading quiz daily..Don't forget to visit it on daily basis to get the latest updated quiz questions!

Lets start quiz!

C Programings quiz:
[Choose page number given below]
Page 1 [Quiz no- 1 to 5]
Page 2 [Quiz no- 6 to 10]
Page 1 [Quiz no- 11 to15]
Page 1 [Quiz no- 16 to 20]
Page 1 [Quiz no- 21 to 25]
Page 1 [Quiz no- 26 to 10]