Test your C Programming Skills

void main() { int a=10,b=20; char x=1,y=0; if(a,b,x,y) { printf("EXAM"); } } What is the output?
XAM is printed
exam is printed
Compiler Error
Nothing is printed
#include void main() { char letter =`Z`; printf(" %c",letter); }
Z
90
Garbage value
Error
Array passed as an argument to a function is interpreted as
Address of the array
Values of the first elements of the array
Address of the first element of the array
Number of element of the array
main() { char thought[2][30]={"Don`t walk in front of me..","I am not follow"}; printf("%c%c",*(thought[0] 9),*(*(thought 0) 5)); } What is the output of this program?
k k
int **array2 = (int **)malloc(nrows * sizeof(int *)); Don`t walk in front of me
I may not follow
K
What is the output of the following code? # include # define a 10 main() { printf("%d..",a); foo(); printf("%d",a); } void foo() { #undef a #define a 50 }
10..10
10..50
Error
0
Description:

A sample test for testing your C programming Skills

Comments
raam
By: raam
1376 days 20 hours 5 minutes ago

iam passed in my online test

naidu
By: naidu
1360 days 18 hours 45 minutes ago

hi this naidu ,i am stding at CADC Bangalore. i got a error for the 2nd question in "Test your C Programming Skills"

naidu
By: Amar
1111 days 20 hours 7 minutes ago

remove '#include', if you're not adding any header file.

naidu
By: pawan tiwari
635 days 22 hours 30 minutes ago

ERROR THE SOURCE FILE IS NOT FOUND

Soumen Mondal
By: Soumen Mondal
1329 days 12 hours 30 minutes ago

ditto writing and compiling will generate error as #include generally followed by some header file.....

gowthami
By: gowthami
1311 days 21 hours 57 minutes ago

hi.....could u xplain me 4th and 5th ques in test ur c programming skills....

gowthami
By: Amar
1111 days 20 hours 3 minutes ago

Question no.4 has got 'print' mistakes, try with following statement:
printf("%c %c", *(thought[0] 9), *(*(thought 0) 5));
Question no. 5, the answer selected is 'WRONG' and the options provided doesn't give the correct option to choose from. Correct answer is '50..50', since its the case of pre-processor directive.

gowthami
By: preeti
982 days 12 hours 5 minutes ago

this ans of ques 5 is absolutely correct, i have checked it bye compiling and running. Global and local definition context is also associated with pre-processor.

gowthami
By: zaheer
896 days 13 hours 14 minutes ago

no the answer is right for 5th question try it once again it is 10..10

gowthami
By: Palwinder
871 days 11 hours 40 minutes ago

yes u r right i checked it

gowthami
By: virender
390 days 18 hours 35 minutes ago

IF you want to improve ur C skills , you can join the open source system group on facebook . we will b satisfied 100% there.

gowthami
By: vignesh
992 days 5 hours 35 minutes ago

for 5th question we define a variable like #define a 10 the value cannot be changed at any part of the program....so the answer is 10 10

gowthami
By: preeti
982 days 12 hours 2 minutes ago

#include
#include
#define a 10
void foo1();
main()
{
printf("%d..",a);
foo1();
#undef a
#define a 40
printf("%d",a);
getch();
}
ans of this code is 10..40, this means the value of a can be changed by #define used in any part of the program depends on the scope.

gowthami
By: zaheer
896 days 13 hours 10 minutes ago

no we can change the value of #define also becoz of local and global variables the value differs

gowthami
By: shivam
660 days 12 hours 31 minutes ago

5 one i can explain u.in # define the value is assigned before compilatin so every where in the program the a is changed with 10 so no matter other things answer is always 10

gowthami
By: gowthami
1311 days 21 hours 56 minutes ago

hi this is gowthami....could u pls xplain me 4th ques in test ur c programming skills......

rajeswari
By: rajeswari
1293 days 19 hours 17 minutes ago

hi this is raji could u explain the 5th question in test u r c programing skills

rajeswari
By: Amar
1111 days 20 hours 3 minutes ago

Question no. 5, the answer selected is 'WRONG' and the options provided doesn't give the correct option to choose from. Correct answer is '50..50', since its the case of pre-processor directive

rajeswari
By: Tarun
725 days 10 hours 18 minutes ago

sir correct ans is 10..10
if u are getting confused then try to print "a"in foo() also . you will get 10..5010

rajeswari
By: sharan
370 days 13 hours 3 minutes ago

nothing its very easy local and global variable value effect..thats it

sarabjit kaur
By: sarabjit kaur
1288 days 17 hours 53 minutes ago

gt problem in 4th n 5th ques.....

shravani
By: shravani
1282 days 15 hours 58 minutes ago

since the changes that are made in function doesn't reflect in main function the value of a in main function remains same i.e., 10

shravani
By: Amar
1111 days 20 hours 1 minutes ago

keep in mind that '#define' is a compiler preprocessor directive. Hence the values should be altered before hand.

sountharcs
By: sountharcs
1278 days 16 hours 7 minutes ago

#include generally followed by some header file.....SO IT WILL PRODUCE error ,,,,can u explain this....

KALPANA
By: KALPANA
1277 days 22 hours 39 minutes ago

so nice all the test

raj
By: raj
1257 days 3 hours 16 minutes ago

In 5th question the defination of function foo() shouldn't have void. since we havent declare the prototype of the function foo(),so the compiler treats the fuction call in line6 as the fuction returns and no.of arguments are same as calling function arguments.so when it jump to function header it shows error as we place wrong return type.

raj
By: raj
1257 days 3 hours 12 minutes ago

i got error for 4th question.. is it correct declaration thought[1]9. i think we can access array element using [index] or adding index value to base adress i.e, (thought+1)+9 like this.. can anybody explain me...

raj
By: Amar
1111 days 20 hours ago

You're right.
There is clear mistake in the specified question over there. Make the needed changes and test your answer :)

raj
By: darshan
709 days 2 hours 29 minutes ago

i think the program is wrong bcoz in declaration double array is used , while printing single array .

yakshendotmail.comra
By: yakshendotmail.comra
1253 days 17 hours 54 minutes ago

solution to 4th problem depends upon representation of 2d array in pointer form...

sandeep
By: sandeep
1251 days 2 hours 4 minutes ago

interesting test like it

sheetal lakra
By: sheetal lakra
1246 days 21 hours 24 minutes ago

i want a reply...plzzzzzzzzzzzzzzzzz

sheetal lakra
By: Amit
1138 days 32 minutes ago

1-4
2-1
3-Address of the first element of the array
4-4
5-1
Amit garg
E-mail ID- logicalamit@yahoo.com
Thanks

sheetal lakra
By: rahulmali
515 days 3 minutes ago

i abuse u

saurabh100
By: saurabh100
1240 days 11 hours 27 minutes ago

any one plz explain me 5th problem....

saurabh100
By: Amar
1111 days 19 hours 59 minutes ago

Question no. 5, the answer selected is 'WRONG' and the options provided doesn't give the correct option to choose from. Correct answer is '50..50', since its the case of pre-processor directive

saurabh100
By: vignesh
992 days 5 hours 37 minutes ago

we define a variable like #define a 10 the value cannot be changed at any part of the program....so the answer is 10 10

vins
By: vins
1240 days 4 hours 4 minutes ago

will any one explain me 4th qn?

vins
By: vins
1240 days 4 hours 3 minutes ago

plz explain me 4 th question

Bharat
By: Bharat
1228 days 15 hours 11 minutes ago

very gud question, plz anyone post the answer

1234567
By: 1234567
1208 days 9 hours 36 minutes ago

4th test doesn't compile at all. I tried it with different c compilers.

prabhat
By: prabhat
1206 days 21 hours 44 minutes ago

hi this is prabhat nice questions thank you. i think in 4th question sign is missing between pointer variable n subscript.

Your Name
By: Your Name
1206 days 18 hours 42 minutes ago

i attempted all question correctly it shows that i am very sound in c....

rika
By: rika
1174 days 2 hours 33 minutes ago

hi! can any body clarify 1st answer.

rika
By: kamlesh
1167 days 10 hours 15 minutes ago

in this prog. there is no syntactical error so there is no compilation error but in if statement there is no valid condition hence nothing is printed.

rika
By: Amar
1111 days 19 hours 56 minutes ago

That is an incorrect explaination Kamlesh.
Its the case of 'Comma' operator. It returns the 'value'(and type) of the last operand, always. Since the value of 'y' is 0, the condition fails. Try changing the sequence and put anything other than 'y' at the last operand and see the result.

Bhaskar
By: Bhaskar
1164 days 11 hours 9 minutes ago

what a rubbish test. Can any one tell me how the author gets the output 10..10 for the last question. It would defenitely give error.

Bhaskar
By: tuttu
1136 days 22 hours 16 minutes ago

yes dear the answer is correct.it is because the inner loop of foo will terminate without printing anything.

Sarbjit
By: Sarbjit
1162 days 12 minutes ago

I think you fram some of the questions wrong.

Valentin
By: Valentin
1161 days 19 hours 32 minutes ago

Most stupid test I ever seen
Just check by compiler and see.For ex. #include without
filename, you will get error instead print result

Valentin
By: preeti
982 days 11 hours 48 minutes ago

hey this is not a stupid test at all, #include must have a header file after it, but at the time of uploading this statement over hare, this header part is eliminated by itself that's y its not appearing in code.

dara singh
By: dara singh
1160 days 20 hours 51 minutes ago

i didn't undesand the process of fouth program
just describe it

brahma chaitanya
By: brahma chaitanya
1150 days 17 hours 7 minutes ago

may i know how it will print k in output in 4rth pgm

kavita sharma
By: kavita sharma
1137 days 23 hours 53 minutes ago

me too get good marks in dis test.........!!!!

tuttu
By: tuttu
1136 days 22 hours 20 minutes ago

dear sir,
thank u for ur effort.it is really helpful.sir i request u to kindly arrange some more questions so that we can practice more also sir u increase the no of questions and set a time barrier qithin which we have complete .
this would help us more.
by the way this effort is also appreciatiable.

"with regards"
amrit upadhyay
(student of cdac acts-chennai)

rahul
By: rahul
1113 days 12 hours 47 minutes ago

fifth question is error. in hader file pls explain this.

rahul
By: Amar
1111 days 19 hours 54 minutes ago

Do not use '#include' in the example.
But the answer selected is 'WRONG' and the options provided doesn't give the correct option to choose from. Correct answer is '50..50', since its the case of pre-processor directive

rahul
By: zaheer
896 days 13 hours 17 minutes ago

no the answer is right it is 10..10 only

anag
By: anag
1099 days 21 hours 43 minutes ago

Question no-5 gives an error beacuse u did not declare a function prototype apart from this error also produce due header file also.

veerabhadrarao
By: veerabhadrarao
1098 days 21 hours 45 minutes ago

very

rohit chatterjee
By: rohit chatterjee
1092 days 15 hours 36 minutes ago

I thank Mr. Masoodi for his efforts at creating this test. However, the test needs a bit of improvement.

After a quick search I found the following:

http://www.prog2impress.com/puzzles.html

I hope this helps other future developers out there!

vamsi564
By: vamsi564
1077 days 57 minutes ago

good

dhaval
By: dhaval
1062 days 11 minutes ago

nice questions... i like it.

dfhd
By: dfhd
1052 days 2 hours 43 minutes ago

Hi
correct me if im wrong. But calling the function "foo()" in main before it is declared will cause compile time error.

dfhd
By: Tarun
725 days 10 hours 20 minutes ago

hi
yes it will give you error saying function should return a variable
try to take foo as int
int foo()
{
}

Neha Sharma
By: Neha Sharma
1027 days 26 minutes ago

I gave 4 correct answers out of 5.

Neha Sharma
By: anil
741 days 2 hours 23 minutes ago

yaa u ... r

meghna sharma
By: meghna sharma
1022 days 15 hours 42 minutes ago

test is simple.....bt can't understand 3 question

Nilesh Shelar
By: Nilesh Shelar
1022 days 1 hours 46 minutes ago

Hi this was my first test here and i scored 2 out of 5

XITIJ_THOOL
By: XITIJ_THOOL
1021 days 15 hours 5 minutes ago

cool i liked it , one of my favorites . Thank you

ANKUR SHUKLA
By: ANKUR SHUKLA
1018 days 1 hours 30 minutes ago

wat is the criteria of avg marks

sonam jain
By: sonam jain
1013 days 23 hours 20 minutes ago

solutons of Qu paper

vidya
By: vidya
1001 days 14 hours 26 minutes ago

there is one wrong questin in the above quiz

elshan
By: elshan
1000 days 11 hours 2 minutes ago

interesting test ... ('-')

Maulik Shah
By: Maulik Shah
983 days 18 hours 25 minutes ago

nice one.....

Laxminarayan Dash
By: Laxminarayan Dash
977 days 12 hours 22 minutes ago

WAH IT IS VERY EASY.I COMPLETED IN 30 SECS.

amar
By: amar
973 days 16 hours 9 minutes ago

i have passed this test
my all answers r correct

hussainy
By: hussainy
972 days 19 hours 26 minutes ago

I like this very much,
wish me luck...

jyothsna
By: jyothsna
970 days 1 hours 12 minutes ago

questions are excellent

Vidhi
By: Vidhi
939 days 23 hours 19 minutes ago

ques r very good but i want c questions so that i can practice.............

kapil
By: kapil
936 days 1 hours 12 minutes ago

nice question in test ,but there should be more wuestion with time limit.

ziya
By: ziya
928 days 33 minutes ago

what a taff quation bt you hav many knowlege thanks

Anshul Jain
By: Anshul Jain
921 days 23 hours 42 minutes ago

nice question, put some more

koushik
By: koushik
911 days 14 hours 2 minutes ago

I think you are a begener

zaheer
By: zaheer
896 days 13 hours 20 minutes ago

Hi gowtami,
Your answer for 5th question is "define a 50" statement here the 'a' is a local variable. so its value persists inside the loop only. thatswhy in main() again 'a' value is printed as 10. icoudn't get solution for 4th sum

zaheer
By: play
889 days 12 hours 57 minutes ago

Nope... 'a' is not variable, its constant(to more precise a literals) and the macros do not ve scope...

So what exactly happens is these macros are resolved before the source file is compiled. The macro substitutions take place in the order they appear in.. i.e, the all appearance is 'a' source file is replaced by 10 first(until before #undef) and subsequent appearance of 'a' if any in source after the #undef and #define a 50 would be replaced by 50..

The point is all this happens line by line

pankaj sewalia
By: pankaj sewalia
896 days 7 hours 8 minutes ago

hey 4th ques i got prob. did anyone explain it,my compiler says" expected ")" before numric constant

vivek singh
By: vivek singh
892 days 18 hours 12 minutes ago

GOOD QUESTIONS

sana
By: sana
890 days 11 hours 49 minutes ago

Is all answers r correct?

niranjan
By: niranjan
879 days 21 hours 36 minutes ago

good skill test

vijaykumar vendra
By: vijaykumar vendra
865 days 17 hours 50 minutes ago

thanks

saurav tyagi
By: saurav tyagi
860 days 22 hours 49 minutes ago

could u just explain me the q.4.....

john abraham
By: john abraham
857 days 18 hours 11 minutes ago

i got zero because of #include(no header file)

lkjhklh
By: lkjhklh
856 days 12 hours 27 minutes ago

I'm 4/5. Quite simple questions.

vivek
By: vivek
855 days 2 hours 23 minutes ago

I GOT 5 MARKS OUT OF 5

vinod chavan
By: vinod chavan
852 days 22 hours 36 minutes ago

good demo.

naveen
By: naveen
851 days 20 hours 36 minutes ago

wt s the use of #include if there is no headerfiles......

Devendra dattatraya dahiphale
By: Devendra dattatraya dahiphale
839 days 18 hours 24 minutes ago

it was good i could solve 3 correct

jaysinhp
By: jaysinhp
796 days 17 hours 22 minutes ago

You should include The stdio.h Which is standard input/output file ! Also Don't write `Z` Because for character it is 'Z' .

adila
By: adila
773 days 2 hours 7 minutes ago

thanks

Mohit
By: Mohit
753 days 15 hours 46 minutes ago

nice test

Meena
By: Meena
749 days 15 hours 46 minutes ago

Its really help full for students...........I Need some C interview questions on inline function can give the question based on that

anil
By: anil
741 days 2 hours 21 minutes ago

what is difference btn ABCD and DCBA format ?

Rajesh
By: Rajesh
708 days 12 hours 20 minutes ago

remove '#include', if you're not adding any header file.Question no.4 has got 'print' mistakes, try with following statement:
printf("%c %c", *(thought[0] 9), *(*(thought 0) 5));
Question no. 5, the answer selected is 'WRONG' and the options provided doesn't give the correct option to choose from. Correct answer is '50..50', since its the case of pre-processor directive.

Rajesh
By: vimjet
694 days 17 hours 26 minutes ago

Question no 5 rellay compiled for you , I have tried to compile with gcc. But I got following error.

ERROR:
array1.c: In function `main':
array1.c:4: parse error before `9'
array1.c:4: parse error before `0'

saidanaik
By: saidanaik
704 days 17 hours 24 minutes ago

hey last question is very very nice... :)

saidanaik
By: saidanaik
704 days 17 hours 24 minutes ago

hey last question is very very nice... :)

mohanapriya c
By: mohanapriya c
703 days 21 hours 19 minutes ago

answer for the 5th question is error na... there is a space b/w # and define which ll cause an error..... is there any objection to my ans myfriend?????

mohanapriya c
By: anvesh
697 days 18 hours 52 minutes ago

Hi

anurag
By: anurag
700 days 17 hours 23 minutes ago

can sm1 xplain me 4th question

anvesh
By: anvesh
697 days 18 hours 54 minutes ago

I got 5 out of 5

vimjet
By: vimjet
694 days 17 hours 30 minutes ago

I don't understand the question 4.
I get compiler error... those you got wright answer for 4 can explain us... pls

vinod thete
By: vinod thete
694 days 30 minutes ago

THANK YOU

vinod thete
By: vinod thete
693 days 32 minutes ago

a

RAJA SINGAM
By: RAJA SINGAM
691 days 23 hours 13 minutes ago

I Like this

satishvaka
By: satishvaka
664 days 18 hours 2 minutes ago

not sufficient .i want some more questions

satishvaka
By: satishvaka
664 days 18 hours 2 minutes ago

not sufficient .i want some more questions

manish patel
By: manish patel
663 days 3 hours 53 minutes ago

gud......

vajid mulla
By: vajid mulla
641 days 52 minutes ago

nmhkyvflufy

vajid mulla
By: vajid mulla
641 days 51 minutes ago

m,opgvfy

asif patel
By: asif patel
634 days 1 hours 38 minutes ago

nfdbnskfnd dbfsdbfsd f d f f dfn fnm.fkldkljioermsajfkjenrjtne ghuiher ewrwenerj bdn bfdbfdn f dn dfberhr fnfndfaaldbfrmeea=ra====meera kaise ho

sanjeet kumar
By: sanjeet kumar
627 days 21 hours 8 minutes ago

All answers r right

Want to learn?

Sign up and browse through relevant courses.

or fill this simple form
Name:
Your Email:
Password:
Country:
Contact no.:


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


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy
Zubair Masoodi
C# Assignment help, C# Homework help, Asp.net help, learn C# and Asp.n
User
3 Members Recommend
154 Followers

Your Facebook Friends on WizIQ

More Tests By Author

Asp.net Online Tests
6 Questions | 5529 Attempts

Asp.net online test (Microsoft Certified Technical Specialist (MCTS)
5 Questions | 11896 Attempts

Asp.Net 2.0
5 Questions | 3040 Attempts

Test your Computer Knowledge 2
26 Questions | 3635 Attempts

Connect