Programming for Problem Solving (3110003) MCQs

MCQs of Programming Test 1

Showing 1 to 10 out of 20 Questions
1.

What is the output of following program

#include<stdio.h>

void main()  
{  
  int i = 2;  
  {  
    int i = 4, j = 5;  
     printf("%d %d", i, j);  
  }    
  printf("%d %d", i, j);  
}  

(a)

4525

(b)

2525

(c)

4545

(d)

None of the these

Answer:

Option (d)

2.

What is the output of this statement "printf("%d", (a++))"?

(a)

The value of (a + 1)

(b)

The current value of a

(c)

Error message

(d)

Garbage

Answer:

Option (b)

3.

What is the output of following program

#include<stdio.h>

void main()  
{  
  int a = 1, b = 2, c = 3:  
  printf("%d", a + = (a + = 3, 5, a))  
}  

(a)

6

(b)

9

(c)

12

(d)

8

Answer:

Option (d)

4.

What does this declaration mean?

int x : 4; 

(a)

X is a four-digit integer.

(b)

X cannot be greater than a four-digit integer.

(c)

X is a four-bit integer.

(d)

None of the these

Answer:

Option (c)

5.

In the C language, the constant is defined _______.

(a)

Before main

(b)

After main

(c)

Anywhere, but starting on a new line.

(d)

None of the these.

Answer:

Option (c)

6.

The correct order of mathematical operators in mathematics and computer programming,

Answer:

Option (b)

7.
#include<stdio.h>

int main ()
{
   printf("IndiaPIN");
   main();
   return 0;

}
Answer:

Option (d)

8.

Which of the following statement shows the correct implementation of nested conditional operation by finding greatest number out of three numbers?

Answer:

Option (a)

9.

A macro can execute faster than a function.

(a)

true

(b)

false

(c)

both are wrong

(d)

both are true

Answer:

Option (a)

10.
#include"stdio.h"
int main()
{
    int i;
    if(i=2,9,3)
        printf("Can't say ");
    else
        printf("Hello ");
    printf("%d\n",i);
}
(a)

Hello 3

(b)

Hello 2

(c)

Can't say 2

(d)

Can't say 3

Answer:

Option (c)

Showing 1 to 10 out of 20 Questions