Question 1

Time: 00:00:00
what is int(*(*ptr (int))(void)

int is function (taking an int argument) returning pointer to pointer to function (taking in a void argument) returning ptr

int is function (taking an int argument) returning pointer to pointer to function (taking in a void argument) returning ptr

ptr is function (taking an int argument) returning pointer to pointer to function (taking in a void argument) returning int

ptr is function (taking an int argument) returning pointer to pointer to function (taking in a void argument) returning int

pointer to pointer argument

pointer to pointer argument

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

PrepInsta User

is int(*(*ptr (int))(vo

PrepInsta User

a

PrepInsta User

in the inner bracket *ptr is a pointer and in the outer bracket we declare another pointer to p

PrepInsta User

in the inner bracket *ptr is a pointer and in the outer bracket we declare another pointer to p

Question 2

Time: 00:00:00
What is Output? func(char *s1,char * s2) { char *t; t=s1; s1=s2; s2=t; } void main() { char *s1=?jack?, *s2=?jill?; func(s1,s2); printf(?%s %s ?,s1,s2); }

 

jack hill

jack hill

Jacks hill

Jacks hill

jack jill

jack jill

Jacks jill

Jacks jill

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 3

Time: 00:00:00
What is output? void main() { int a[5] ={1,2,3,4,5},i,j=2,b; for (i =0;i<5;i++ ) func(j,a[i]); for (i =0;i<5;i++ ) printf(?%d?,a[i]); } func(int j,int *a) { j=j+1; a=a+j; b= b+2; }

12345

12345

13579

13579

23456

23456

54321

54321

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 4

Time: 00:00:00
void main() { for (a=1;a<=100;a++) for(b=a;b<=100;b++) foo(); } foo() { } how many times foo will be called.

5555

5555

5050

5050

6666

6666

6060

6060

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 5

Time: 00:00:00
What will be the output

main() 



    int x=20,y=35; 

    x=y++ + x++; 

    y= ++y + ++x; 

    printf("%d%d",x,y);

}

5 7 8 4

5 7 8 4

5 7 9 4

5 7 9 4

5 7 9 2

5 7 9 2

5 7 8 8

5 7 8 8

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 6

Time: 00:00:00

What will be the o/p? main()  {  int x=5;  printf("%d,%d,%d",x,x<<2,x>>2); }

5,21,1

5,21,1

5,20,1

5,20,1

6,20,5

6,20,5

6.21,3

6.21,3

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 7

Time: 00:00:00

What is the output? main () { int i, j, k; i = 3;  j =2*(i++);  k =2*(++i); } which one of the given option is correct?

j = 8,k =12

j = 8,k =12

j = 6, k=10

j = 6, k=10

j = 9,k=14

j = 9,k=14

j=4,k = 8

j=4,k = 8

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 8

Time: 00:00:00
How many time it will execute the loop?
main()


{

int i;

i=0;

do

{

--i;

printf("%d",i);

i++;

}

while(i>=0);

}

2

2

4

4

10

10

infinite

infinite

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 9

Time: 00:00:00
Switch (option)
{


case 'H' : printf("Hello");

case 'W' : printf("Welcome");

case 'B' : printf("Bye");

break;

}

what would be the output if option = 'H' ?

Welcome Bye Hello

Welcome Bye Hello

Hello Welcome Bye

Hello Welcome Bye

Hello Bye Welcome

Hello Bye Welcome

Bye Hello Welcome

Bye Hello Welcome

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 10

Time: 00:00:00

What values of c will get Printed? main() { int a,b,c; a=10; b=20; c=printf("%d",a)+ ++b; printf("\n%d",c); }

24

24

23

23

43

43

44

44

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

["0","40","60","80","100"]
["Need more practice! \r\n","Keep trying! \r\n","Not bad! \r\n","Good work! \r\n","Perfect! \r\n"]

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Get over 200+ Courses under One Subscription

mute

Don’t settle Learn from the Best with PrepInsta Prime Subscription

Learn from Top 1%

One Subscription, For Everything

The new cool way of learning and upskilling -

Limitless Learning

One Subscription access everything

Job Assistance

Get Access to PrepInsta Prime

Top Faculty

from FAANG/IITs/TOP MNC's

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.

Comments

2 comments on “Persistent C Programming Quiz-1”