Вы находитесь на странице: 1из 4

1. Which of the following statements are correct about the below C-program?

#include<stdio.h>

int main()

{

int x = 10, y = 100%90, i;

for(i=1; i<10; i++) if(x != y); printf("x = %d y = %d\n", x, y);

return 0;

}

1 : The printf() function is called 10 times. 2 : The program will produce the output x = 10 y = 10 3 : The ; after the if(x!=y) will NOT produce an error. 4 : The program will not produce output.

 

1A.

A.

2, 3B.

B.

3, 4C.

C.

4D.

D.

 

[#]

2. What will be the output of the program?

 

#include<stdio.h>

int main()

{

int k, num=30; k = (num>5 ? (num <=10 ? 100 : 200): 500); printf("%d\n", num);

return 0;

}

A.

200A.

30B.

B.

100C.

C.

500D.

D.

 

[#]

3. The keyword used to transfer control from a function back to the calling function is

switch  [#] 3. The keyword used to transfer control from a function back to the calling

A.

[#] 3. The keyword used to transfer control from a function back to the calling function

B.

goto

go back  [#] 3. The keyword used to transfer control from a function back to the calling

C.

 
D. return

D. return

 

[#]

4. Which of the following statements are correct about the function?

   

long fun(int num)

{

int i;

long f=1;

for(i=1; i<=num; i++) =

f

f * i;

 

return f;

}

 

The function calculates the value of 1 raised to power num.A.

A.

 

The function calculates the square root of an integerB.

B.

The function calculates the factorial value of an integerC.

C.

None of aboveD.

D.

 

[#]

5. Which of the statements is correct about the program?

   

#include<stdio.h>

 

int main()

{

float a=3.14;

char *j;

j = (char*)&a; printf("%d\n", *j);

 

return 0;

}

 

It prints ASCII value of the binary number present in the first byte of a float variable a . a.

A.

 

It prints character equivalent of the binary number present in the first byte of a float variable a . a.

B.

It will print 3C.

C.

It will print a garbage valueD.

D.

 

[#]

6. If char=1, int=4, and float=4 bytes size, What will be the output of the program ?

#include<stdio.h>

int main()

{

char ch = 'A'; printf("%d, %d, %d", sizeof(ch), sizeof('A'), sizeof(3.14f)); return 0;

}

1, 2, 4A. 1, 4, 4 B. 2, 2, 4 C. 2, 4, 8 D.   [#]

A.

1, 4, 41, 2, 4 A. B. 2, 2, 4 C. 2, 4, 8 D.   [#] .7.

B.

2, 2, 41, 2, 4 A. 1, 4, 4 B. C. 2, 4, 8 D.   [#] .7.

C.

2, 4, 81, 2, 4 A. 1, 4, 4 B. 2, 2, 4 C. D.   [#] .7.

D.

 

[#]

.7. What will be the output of the program ?

 

#incl ude<stdio.h>

int main()

{

char str[] = "Nagpur";

str[0]='K';

printf("%s, ", str);

str = "Kanpur";

printf("%s", str+1);

return 0;

}

Kagpur, KanpurA.

A.

Nagpur, KanpurB.

B.

Kagpur, anpurC.

C.

ErrorD.

D.

 

[#]

8. Which header file should you include, if you are going to develop a function, which can accept variable number of arguments?

 

varagrg.hA.

A.

stdlib.hB.

B.

stdio.hC.

C.

stdarg.hD.

D.

 

[#]

9. va_list is an array that holds information needed by va_arg and va_end

array that holds information needed by va_arg and va_end A. B. True False How many times

array that holds information needed by va_arg and va_end A. B. True False How many times

A.

B.

True

False

How many times the program will print "IndiaBIX" ?

int main()

{

10. #include<stdio.h>

printf("IndiaBIX");

main();

return 0;

}

Infinite timesprintf( "IndiaBIX" ); main(); return 0 ; } A. 32767 times B. 65535 times C. Till

A.

32767 times); main(); return 0 ; } Infinite times A. B. 65535 times C. Till stack overflows

B.

65535 timesmain(); return 0 ; } Infinite times A. 32767 times B. C. Till stack overflows D.

C.

Till stack overflows0 ; } Infinite times A. 32767 times B. 65535 times C. D. Practical: 1. Program

D.

Practical:

1.

Program to reverse a given number

2.

Program to find the greatest of 3 numbers.

3.

Program to display arthematic Operation using switch case.

4.

Program to print sequence.

 

*

 

*

*

 

*

*

*

 

*

*

*

*

*

*

*

*

*

5.

Program to find weather a given number is prime or not.

6.

Program to find the maximum number in an array.

7.

Program to find multiplication of two matrices.

8.

Program to find transpose of matrix.

9.

Program to find factorial of number using recursion.

10. Program to show working of string functions.