Depth of C online Test

What is the size of data type long int in Solaris operating system ?


main()

{

f();

f();

f();

}

f()

{

auto int a=1;

a++;

printf("%d",a);

}


main()

{

f();

f();

f();

getch();

}

f()

{

static int a;

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

}


Suppose there is two file A.C and B.C

If variable int a is decleared in A.C file as global variable and if wanna use that variable in B.C file then which keyword we have to add before int a .Means what would be the value of ? in following statement.

? int a;


Following statement is true or wrong ?

short a,b,c;

c=a+b;


Following statement is true or wrong for declearing variable a?

long a;

register a;

unsigned a;

short a;


what would be the value of a?

main()

{

const int a=5;

int * const ptr=&a;

*ptr=20;

printf("%d",a);

}


will the following code give error ?

int a;

flaot *ptr=&a;


what would be the output of folloing code?

main()

{

printf("%x"+1,255);

}


what would be the output ?

main()

{

printf(" \\\65 "):

}


what would be the output of code?

main()

{

printf("%s","target"+printf("hi"));

}


what wii be the output of code?

main()

{

scanf("%1d%2d%2d",&a,&b,&c);

// suppose user enter valoe a=12345,b=55,c=560;

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

}


what will be the op?

main()

{

int a=4,b=4,c=9;

if(a>b)

if(a==b)

printf("both are same");

else

printf("how do u feel");

}







































































































Description:

This is test for enhancing programming logic for enthusiastic C programmer

Comments
bharat
By: bharat
654 days 6 hours 25 minutes ago

8th question will give an error..there is a spelling mistake.FLOAT has been typed as FLAOT..

Anurag Sharma
By: Anurag Sharma
653 days 16 hours 19 minutes ago

sry...It was written by mistake...code is right ,what will be the answer ?

Anurag Sharma
By: Anurag Sharma
653 days 16 hours 6 minutes ago

I'd like to say to Ravi and Rajdip that u've done great work......i'm gonna create an another test of c for who have given right answer greater that or equal half question...If anyone wanna know reason of particular question then write question no and post to it in comment..tc guys and galz....

jagadeesh
By: jagadeesh
651 days 3 hours 2 minutes ago

tell me abt 7th q ans hw it comes..may b wrong..some qs not properly questioned..not knw whether true r false

jagadeesh
By: Anurag Sharma
650 days 15 hours 55 minutes ago

t is 100 % right question.Actually this question is about drawback of C language.If u will try to compile this code in OOPS then error will be occur.

Similarly, an another question i have added in which float pointer is gonna be store address of int type.This is suspicious pointer.It is used in making of virus program.Suspicious pointer can't work in OOPS because of type compatibility. All questions of test are 100 % right.

jagadeesh
By: Kiran SVS
628 days 14 hours 15 minutes ago

I guess it does some type of casting to remove const.Because viceversa is also present, like below

int a;
const int * ptr =

jagadeesh
By: Kiran SVS
628 days 14 hours 14 minutes ago

correction:
const int * ptr =

jagadeesh
By: Anurag Sharma
628 days 4 hours 9 minutes ago

U r wrong.Vice versa is not present.U r trying to say that following statmeent will change value of a....

int a=10;
const int *p=

Anurag Sharma
By: Anurag Sharma
628 days 4 hours 5 minutes ago

hello Miss Neha.How do u find ma test ? My test have dazzled u Am i right ?

Anurag Sharma
By: Anurag Sharma
628 days 2 hours 40 minutes ago

Hi guys n gals.I've created new test C.Take a look around it !

Lahuraj
By: Lahuraj
612 days 15 hours 26 minutes ago

Hi Anurag............

test was really good........

Lahuraj
By: Anurag Sharma
612 days 3 hours 7 minutes ago

Thz buddy for attempting ma test n 4 liking ma test.......

sumesh prabhune
By: sumesh prabhune
604 days 18 hours 45 minutes ago

Your question 5 is wrong...how can it possibly give an error??

sumesh prabhune
By: sumesh prabhune
604 days 7 hours 57 minutes ago

Ur Q 7 will also give an error as the stmt p =

nehajain
By: nehajain
578 days 14 hours 18 minutes ago

printf("\\\\65");
hw it will give 5

nehajain
By: nehajain
578 days 14 hours 18 minutes ago

printf("\\\\65");
hw it will give 5

praveen
By: praveen
553 days 3 hours 23 minutes ago

good work but...
check Q5,Q7

bekkam srinivas
By: bekkam srinivas
459 days 13 hours 56 minutes ago

saale sab questions k ans wrong hai!!!!!.. khudko kuch aata hai ke nahi dekh pehle...

bekkam srinivas
By: bekkam srinivas
459 days 13 hours 56 minutes ago

saale sab questions k ans wrong hai!!!!!.. khudko kuch aata hai ke nahi dekh pehle...

bekkam srinivas
By: Anurag Sharma
454 days 12 hours 46 minutes ago

agar c nahi aati to y did u took attemp my test.My test is for guy who r maniac abt that.not u who r lackless,freaky......go n attempt let us c

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
Anurag Sharma
student
User
7 Followers
Tests: 2

Your Facebook Friends on WizIQ

More Tests By Author

Play with C
13 Questions | 83 Attempts

Give live classes, create & sell online courses

Try it free Plans & Pricing

Connect