Persistent C Programming Quiz-1

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

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

a

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

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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

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

Start

["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%

Completed

0/10

Accuracy

0%

Prime

Prime Mock

Topic-wise Full Mock and much more

(For Persistent)
Get Prime Mock
Get Prepinsta Prime

Get all 200+ courses offered by Prepinsta

Never Miss an OffCampus Update

Get OffCampus Updates on Social Media from PrepInsta

Follow us on our Media Handles, we post out OffCampus drives on our Instagram, Telegram, Discord, Whatsdapp etc.

Get Hiring Updates
Amazon,Google,Delottie & 30+companies are hiring ! Get hiring Updates right in your inbox from PrepInsta

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.

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.

Get PrepInsta Prime Subscription

Get access to all the courses that PrepInsta offers, check the out below -

Companies

TCS, Cognizant, Delloite, Infosys, Wipro, CoCubes, KPMG, Amazone, ZS Associates, Accenture, Congnizant & other 50+ companies

Programming

Data Structures, Top 500 Codes, C, C++, Java Python & other 10+ subjects

Skills

Full Stack Web Development, Data Science, Machine Learning, AWS Cloud, & other 10+ skills and 20+ projects

Comments

2 comments on “Persistent C Programming Quiz-1”