Programming and Data Structures-Programming in C (GATE Computer Science): Questions 112 - 117 of 134

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: 112

» 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: 113

» 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

Question number: 114

» 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.     char *str="c-pointer";
  4.     printf("%*.*s",10,7,str);
  5. }

Choices

Choice (4) Response

a.

c-pointer

b.

c-pointer null

c.

c-point

d.

null

Question number: 115

» Programming and Data Structures » Programming in C

MCQ▾

Question

How many different trees are possible with 10 nodes?

Choices

Choice (4) Response

a.

1014

b.

1200

c.

1400

d.

1000

Question number: 116

» Programming and Data Structures » Programming in C

MCQ▾

Question

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

  1. int extern x;
  2. int  extern  x;
  3. void  main() { 
  4.     printf("%d"x);
  5.     x = 2;
  6.     getch();
  7. }
  8. int  x = 23;

Choices

Choice (4) Response

a.

0

b.

23

c.

2

d.

error

Question number: 117

» 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.     if(printf("cquestionbank")) printf("I know c");
  4.     else printf("I know c++");
  5. }

Choices

Choice (4) Response

a.

I know c

b.

I know c++

c.

know Java

d.

None of the above

Sign In