GATE Computer Science: Questions 403 - 406 of 913

Get 1 year subscription: Access detailed explanations (illustrated with images and videos) to 913 questions. Access all new questions we will add tracking exam-pattern and syllabus changes. View Sample Explanation or View Features.

Rs. 450.00 or

Question number: 403

» Programming and Data Structures » Programming in C

MCQ▾

Question

What will be output if you will compile and execute the following c code?

  1. void start();
  2. void end();
  3. #pragma startup start #pragma exit end int static i;
  4. void main()
  5. {
  6.     printf("nmain function: %d",++i);
  7. }
  8. void start()
  9. {
  10.     clrscr();
  11.     printf("nstart function: %d",++i);
  12. }
  13. void end()
  14. {
  15.     printf("nend function: %d",++i);
  16.     getch();
  17. }

Choices

Choice (4) Response

a.

error

b.

main function: 2end function: 3start function: 1

c.

start function: 1main function: 2end function: 3

d.

main function: 2start function: 1end function: 3

Question number: 404

» Algorithms » Upper and Lower Bounds

MCQ▾

Question

The complexity of the average case of an algorithm is

Choices

Choice (4) Response

a.

Much more complicated to analyze than that of worst case

b.

Simple to analyze than that of worst case

c.

Sometimes more complicated and some other times simpler than that of worst case

d.

All of the above

Question number: 405

» Programming and Data Structures » Programming in C

MCQ▾

Question

What will be output if you will compile and execute the following code?

  1. void main()
  2. {
  3.     int a,b;
  4.     a=1,3,15;
  5.     b=(2,4,6);
  6.     clrscr();
  7.     printf("%d ",a+b);
  8.     getch();
  9. }

Choices

Choice (4) Response

a.

21

b.

17

c.

7

d.

3

Question number: 406

» Programming and Data Structures » Programming in C

MCQ▾

Question

What will be output if you will compile and execute the following c code?

  1. void main()
  2. {
  3.     int i;
  4.     float a=5.2;
  5.     char *ptr;
  6.     ptr=(char *)&a;
  7.     for(i=0;
  8.     i<=3;
  9.     i++) printf("%d ",*ptr++);
  10. }

Choices

Choice (4) Response

a.

Garbage

b.

102 56 - 80 32

c.

102 102 - 90 64

d.

3 edges 0 0 0 0

f Page
Sign In