TEST YOUR C PROGRMMING SKILLS

What is the output:

int main()

{

int a=0;

#if(a==0)

printf("equal");

#elseif

printf("not equal");

#endif

return 0;

}


#include<stdio.h>

int main()

{

for(;NULL;)

printf("Hello Dear");

return 0;

}


#include<stdio.h>

int main()

{

int x=25;

if(!!x)

printf("%d",!x);

else

printf("%d",x);

return 0;

}


#include<stdio.h>

int main()

{

float a=0.5;,b=0.9;

if(a&&b>0.9)

printf("SACHIN");

else

printf("RAHUL");

return 0;

}


#include<stdio.h>

int main()

{

int x=5,y=10;

if(!(!x)&&x)

printf("%d",x);

else

printf("%d",y);

return 0;

}


#include<stdio.h>

int main()

{

int a,b;

a=-3--3;

b=-3--(-3);

printf("%d %d"'a,b);

return 0;

}


#include<stdio.h>

int main()

{

int x;

x=-2+11-7*9%6/12

printf("%d",x);

return 0;

}


main()

{

int *c;

c=check(10,20);

printf("c=%u\n",c);

}

check(int i,int j)

{

int *p,*q;

p=&i;

q=&j;

if(i<=45)

return(p);

else

return(q);

}


main()

{

float *foo();

float p=23.5,*q;

q=&p;

printf("\nq before call=%u",q);

q=foo(&p);

printf("\nq after call=%u",q);

}

float *foo(float *r)

{

r=r+1;

return(r);

}

HINT: address of p=5498

}


main()

{

printf("%p",,main);

}













































































































Description:

This test includes 10 C Basic fundamentals related questions.
Questions are very tricky.Attempt Test and enjoy Questions.

Tags:

C

Comments
Zubair Masoodi
By: Zubair Masoodi
634 days 12 hours 6 minutes ago

Thanks good test.
I also did good, got 9/10

sashank
By: sashank
633 days 11 hours 22 minutes ago

PROGRAMS ARE NOT CLEARLY WRITTEN TO UNDERSTAND

sashank
By: Neha Sharma
633 days 10 hours 59 minutes ago

i wrote clearly but after publishing theese are not printed clearly i dont know why.........

sashank
By: amit priyadarshi
633 days 5 hours 7 minutes ago

Hello Mam.I am studying in BIT MESRA(Ranchi).You are a proffesional C programmer and ur questions posted r so gd.. .Although if u dnt know me,still i am approaching to u with a humble request.I am having lots of confusion and wants to discuss those with u.If u dnt have a prob.,plz allow me to talk with u.My e-mail id
amit.darshi@gmail.com

sashank
By: Manoj Damkondwar
571 days 13 hours 21 minutes ago

i wrote clearly but after publishing theese are not printed clearly i dont know why.........

what about tell you friend

sashank
By: niranj
311 days 13 hours 23 minutes ago

its good test being printed in a improper way

prakash rathi
By: prakash rathi
632 days 18 hours 6 minutes ago

hello mem...thanks for giving this opportunity to cheak where are stand in market.
pls give more test with some explanation.

Kiran SVS
By: Kiran SVS
632 days 15 hours 59 minutes ago

I left comments on a couple of questions.
Pls try to reply on those, to figure out the correct answers.
Also it is good to mention the OS and the compiler.

Vaibhav vijay
By: Vaibhav vijay
632 days 14 hours 7 minutes ago

Interesting..
plz post more q in c or other pl.

sakamatsu
By: sakamatsu
632 days 10 hours 29 minutes ago

in my opinion:
Q2 : correct answer : Blank
Q5 : correct answer : 5
Q6 : correct answer : Garbage value (not included in answers)

sakamatsu
By: Kiran SVS
632 days 7 hours 43 minutes ago

Q2) Ideally the answer should be Blank, but strangly it prints Hello Dear once, on a Turbo C compiler.
Q5) Correct answer: 5
Q6) The answer mentioned by Neha is correct i.e (0 -6). The problem is question is not showing up correctly.
Q8) Neha, have you mentioned the answer as Error message because the prototype is missing?

laxman
By: laxman
632 days 5 hours 4 minutes ago

Hai.... its gr8 to take test. plz post few more test's like this when u havee free time.. I am more interested in test's like this.......

manohar
By: manohar
632 days 3 hours 3 minutes ago

hi

Rishi Gaurav
By: Rishi Gaurav
630 days 8 hours 31 minutes ago

Well,
Neha it was good to have ur test...

I also Love 'C' and like messing with it.

You have got one of your question Incorrect

#include

int main()
{
int x=5,y=10;
clrscr();
if(!(!x)

Rishi Gaurav
By: gobinath
75 days 11 hours 36 minutes ago

ya it is incorrect

Arnav Mukhopadhyay
By: Arnav Mukhopadhyay
630 days 7 hours 17 minutes ago

Some questions have compiler issues and OS platform issues....
And some are not at all correct....
Check the questions...mention the commpiler...platform (UNIX, LINUX, WINDOWS, DOS all differs in memory arrangement and limits program execution compatibility)

printf("%p", main);
In WINDOWS/DOS prints the value at the location of MAIN.... UNIX/LINUX ELF creates program segment as LOCKED for use by DATA SEGMENT...So there it cause Segmentation error but not on windows....

for(; NULL; )
printf(...);

watvr....prints nothing. it aint an infinite loop anywhere...NULL= false condition and the loop exits before the body is executed.

Arnav Mukhopadhyay
By: sumesh prabhune
605 days 3 hours 46 minutes ago

Good one!...many of the tests here "assume" a lot of things..Stuff like far and huge pointer are obsolete when it comes to Linux and gcc ...another is size of pointers and data types..Many answers given are horribly wrong when run on gcc,which is the standard compiler for C..Successfully running ur code on Turbo C is a method of hiding grave program errors!!

Gaurav
By: Gaurav
630 days 6 hours 5 minutes ago

test was good,but i think ther shud hav been explanation for the answers

mitender
By: mitender
630 days 4 hours 15 minutes ago

hey i think ur answer of the 2nd or third are wrong ...
it is showing 1 but actually it is 5..
so correct it..
have a nice day.

Anurag Sharma
By: Anurag Sharma
628 days 15 hours 32 minutes ago

take ma test Miss Neha.n check urself really in c

Anurag Sharma
By: Neha Sharma
627 days 18 hours 23 minutes ago

Thanks
Mr. Anurag your test is really very nice....
Keep it up.

Anurag Sharma
By: arunprasath
626 days 6 hours 56 minutes ago

call 7373339225

Anurag Sharma
By: Arun Prasath
566 days 5 hours 48 minutes ago

Hi,
Could you train me?i am in Tamilnadu please sent you next class when will start

Email: ArunArunIt@gmail.com

Anurag Sharma
By: shreedhar
265 days 12 hours 37 minutes ago

the answer for 5 question the i think ans is 5 not 1

Ammar
By: Ammar
627 days 20 hours ago

Good job for that test, regardless of increment of faults placed

kaushal singh thakur
By: kaushal singh thakur
627 days 15 hours 48 minutes ago

thank you for this i did best next time...

sugunakar.am
By: sugunakar.am
627 days 11 hours 17 minutes ago

thank u mam

Madhavi
By: Madhavi
626 days 21 hours 49 minutes ago

If this was the question , I verified the answer its 5. Your results say its 1. Can you please explain?

#include
int main()
{
int x = 5,y = 10;

if(!(!x)

vishwanath dalvi
By: vishwanath dalvi
626 days 17 hours 20 minutes ago

Question NO 6

#include "stdio.h"

int main()
{
int a;
a = -3--(-3);
printf("%d",a);
return 0;
}

answer is wrong here v get error of Location value is incorrect ...

jagadeesh
By: jagadeesh
621 days 13 hours 21 minutes ago

Q's are nice...

jagadeesh
By: jagadeesh
621 days 13 hours 18 minutes ago

some ans seem to be incorrect..better to give explanation...

vipul
By: vipul
621 days 9 hours 57 minutes ago

Hey Neha Can YOu please give me the detailed answers?

abazaid
By: abazaid
620 days 9 hours 42 minutes ago

the test full of mistakes , Please Neha rerun the tasks in test :)

avish munjal
By: avish munjal
617 days 13 hours 25 minutes ago

please post the solutions on my gmail avishmunjal@gmail.com
test was good.it took a little bit of time but overall questions were tricky

avish munjal
By: avish munjal
617 days 13 hours 25 minutes ago

please post the solutions on my gmail avishmunjal@gmail.com
test was good.it took a little bit of time but overall questions were tricky

avish munjal
By: avish munjal
617 days 13 hours 25 minutes ago

please post the solutions on my gmail avishmunjal@gmail.com
test was good.it took a little bit of time but overall questions were tricky

avish munjal
By: avish munjal
617 days 13 hours 25 minutes ago

please post the solutions on my gmail avishmunjal@gmail.com
test was good.it took a little bit of time but overall questions were tricky

avish munjal
By: avish munjal
617 days 13 hours 24 minutes ago

please post the solutions on my gmail avishmunjal@gmail.com
test was good.it took a little bit of time but overall questions were tricky

avish munjal
By: avish munjal
617 days 13 hours 23 minutes ago

please post the solutions on my gmail avishmunjal@gmail.com
test was good.it took a little bit of time but overall questions were tricky

amjad
By: amjad
616 days 13 hours 10 minutes ago

neha...i would like to ask u whether u hav used turbo c compiler or linux...coz last question will print address of main ven it comes to turbo c compiler...

deepak
By: deepak
614 days 10 hours 29 minutes ago

the first question answer's wrong.. it gives 2 errors about "constant expression required" and "unknown preprocessor directive: 'elseif' " and one warning : 'a' is assigned a value that is never used

lakshmi manasa
By: lakshmi manasa
613 days 15 hours 40 minutes ago

heyy i didn't understand this que can u plzz explain it for me?

lakshmi manasa
By: lakshmi manasa
613 days 15 hours 33 minutes ago

i mean im not gettin ur questions

lakshmi soundarya
By: lakshmi soundarya
612 days 15 hours 15 minutes ago

wat does !! mean?

raudra
By: raudra
581 days 15 hours 59 minutes ago

WHEN WILL U GIVE NEXT TEST

raudra
By: raudra
581 days 15 hours 59 minutes ago

WHEN WILL U GIVE NEXT TEST

kunal
By: kunal
572 days 16 hours 42 minutes ago

it was a gud fundas checking test ,had fun in taking it.

uday
By: uday
569 days 7 hours 31 minutes ago

Hi

good work

piyush
By: piyush
564 days 18 hours 50 minutes ago

hi neha it is interstng to take ur test!!!!!!!!!!!!!!!!!

kavita sharma
By: kavita sharma
557 days 5 hours 56 minutes ago

plz... explain ans of 5th ques.

prafulla sahu
By: prafulla sahu
556 days 12 hours 6 minutes ago

thanks mam it was a good test

ayush
By: ayush
552 days 4 hours 9 minutes ago

hii please give solution to every question so that it can easily understandable by beginner also

raghavendra
By: raghavendra
547 days 7 hours 22 minutes ago

Answer to Question 5 is 5 (not 1).
Question 2 is not infinite loop, but blank. Please check.

se song
By: se song
531 days 10 hours 31 minutes ago

Hi
why the answer's question 5 is 1? why not 5?

Suriya
By: Suriya
531 days 5 hours 2 minutes ago

Hai! Friend,Could you send me the solutions to this test to my mail-id: suryalathika@gmail.com?

kaviyarasu sivanandham
By: kaviyarasu sivanandham
508 days 20 hours 25 minutes ago

Hi neha sharma ur looking so beauty in this clip . modern dress is sute for u well . But shuty is perfect for u.I m join to u for this skill development .
CONTACT : sivakaviyarasu@yahoo.com

baru
By: baru
507 days 4 hours 54 minutes ago

questions r gud......but plz follow "indentation"

hitesh
By: hitesh
502 days 9 hours 15 minutes ago

thnx neha,
i'm a first sem student of b.tech. branch ECE.
will youu explain me what this if(!x) means....
i couldn't understand it...
my e-mail id is,"hiteshnehra2@gmail.com"
nd thnx once again 4 this aussm test

sandeep
By: sandeep
501 days 6 hours 2 minutes ago

hello mam, m sandeep......
mam, u are the proffesional c programmer,and u are working in IT company as u told,
mam plz update more practice c programming tests,
and also give the suggestion that i should have to learn java also or not,
thnx mam

mohana
By: mohana
496 days 11 hours 37 minutes ago

i want the explanation for 5th que

Ajay Kuamr
By: Ajay Kuamr
495 days 16 hours 40 minutes ago

it was quite good test

Priyanka S G
By: Priyanka S G
495 days 10 hours 37 minutes ago

thank you very much for creating the tests like this... this will be very useful for all who want to go for a software company for attending interviews...

Priyanka S G
By: Priyanka S G
495 days 10 hours 34 minutes ago

please make the links as the simplest one... it will be very useful for all... this complicated link cannot be remenbered by everyone... thank you...

mk
By: mk
477 days 22 hours 13 minutes ago

most of the answers are wrong.please check your answers by actually RUNNING it and not just posting answers

hariharapandian
By: hariharapandian
474 days 9 hours 5 minutes ago

Really tricky questions only...

nik
By: nik
465 days 3 hours 12 minutes ago

Kind of simple questions... just follow the rules n go far. simple.

vedprkasha
By: vedprkasha
439 days 13 hours 46 minutes ago

gggggggggggg

anil kumar soni
By: anil kumar soni
438 days 7 hours 27 minutes ago

your ans is wrong for 5th qustion right 5

jyotiranjan sharma
By: jyotiranjan sharma
431 days 2 hours 1 minutes ago

was there a question from c sharp

priya
By: priya
426 days 14 hours 4 minutes ago

I think it will be better to give How the ANSWER is comming for the given program,with the answer...

balu
By: balu
380 days 10 hours 49 minutes ago

i love u

mohanapriya c
By: mohanapriya c
317 days 11 hours 3 minutes ago

thanks neha....:)

rinku
By: rinku
305 days 15 hours 57 minutes ago

i think the answer of question .5 is 5 not 1

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
Neha Sharma
Working in an IT company as a C-Programmer.
User
149 Followers
Test: 1

Your Facebook Friends on WizIQ

Give live classes, create & sell online courses

Try it free Plans & Pricing

Connect