C Programming Test

Predict the output or error(s) for the following:

main()

{

char s[ ]="man";

int i;

for(i=0;s[ i ];i++)

printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]);

}


Predict the output or error(s) for the following:

void main()

{

int const * p=5;

printf("%d",++(*p));

}


What will the output of following code?

#include<stdio.h>

int main(){

int a=0;

#if (a==0)

printf("Equal");

#else if

printf("Not equal");

#endif

return 0;

}


What will be output if you will execute following c code?

#include<stdio.h>

int main(){

for(;NULL;)

printf("cquestionbank");

return 0;

}


What will be output if you will execute following c code?

#include<stdio.h>

int main(){

int x=25;

if(!!x)

printf("%d",!x);

else

printf("%d",x);

return 0;

}


What will be output if you will execute following c code?

#include<stdio.h>

int main(){

float a=0.5, b=0.9;

if(a&&b>0.9)

printf("Sachin");

else

printf("Rahul");

return 0;

}


What will be output if you will execute following c code?

#include<stdio.h>

int main(){

int x=5, y=10;

if(!(!x) && x)

printf("%d",x);

else

printf("%d",y);

return 0 ;

}


What will be output if you will compile and execute the following c code?

void main(){

int a=5;

float b;

printf("%d",sizeof(++a+b));

printf(" %d",a);

}


What will be output if you will compile and execute the following c code?

void main(){

char *str;

scanf("%[^\n]",str);

printf("%s",str);

}


What will be output if you will compile and execute the following c code?

void main(){

int array[3]={5};

int i;

for(i=0;i<=2;i++)

printf("%d ",array[i]);

}




























































































Description:

Here are few questions which will test your C Knowledge.
Take the test and reply me.

Comments
samar
By: samar
538 days 23 hours 50 minutes ago

My message for those who are trying for the first time.plz they see the test practice on pc then come back.u will be winner

manishkumarsingh
By: manishkumarsingh
414 days 2 hours 12 minutes ago

out put of 10th ques. is not correct

Want to learn?

Sign up and browse through relevant courses.

Name:
Your Email:
Password:
Country:
Contact no:


Area code Number
Subjects you are interested in:
Word verification: (Enter the text as in image)


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy
Pruthwiraj Ghadge
Logic building is the Key to Programmming
User
42 Followers

Your Facebook Friends on WizIQ

More Tests By Author

DBMS and SQL Basics
20 Questions | 1400 Attempts

HTML QUIZ
20 Questions | 770 Attempts

Basics of C
5 Questions | 130 Attempts

Explore Similar Courses

Give live classes, create & sell online courses

Try it free Plans & Pricing

Connect