II Sem Bcom Programming With c c Internal i (2)
II Sem Bcom Programming With c c Internal i (2)
a) LowerCase letters
b) UpperCase letters
c) CamelCase letters
d) None of the mentioned
1. #include <stdio.h>
2. voidmain()
3. {
4. int x =5*9/3+9;
5. }
a) 3.75 b) Depends on compiler c) 24 d) 3
13. The format identifier ‘%i’ is also used for _____ data type. ( )
a) char
b) int
c) float
d) double
14. What will be the output of the following C code considering the size of a short int
is 2, char is 1 and int is 4 bytes? ( )
1. #include <stdio.h>
2. intmain()
3. {
4. shortinti=20;
5. char c =97;
6. Float d = 1.002;
7. printf("%d, %d, %d \n",sizeof(i),sizeof(c),sizeof(d));
8. return0;
9. }
a) 2, 1, 2 b) 2, 1, 4 c) 2, 1, 6 d) 2, 1, 8
#include<stdio.h>
#include<conio.h>
void main()
{
int i = 95;
float x = 90.99 ;
char ch = 'A' ;
i = x ;
printf("%d",i);
x = i ;
printf("%f",x);
i = ch ;
printf("%d",i);
}
a) 90.99, 95, A b) 90, 95.000000, 65 c) 7.000000, 8 d) 7, 8
16. What will be the output of the following C code snippet? ( )
1. #include <stdio.h>
2. voidmain ()
3. {int a,b;
a = 1;
b = 2;
4. a<b?return1:return2;
5. }
a) returns 1
b) returns 2
c) no value
d) all of the above
n = 1;
printf("%d, %d \n", 3*n, n++);
a) Output will be 3, 2
b) Output will be 3, 1
c) Output will be 6, 1
d) Output will be 6, 2
1. #include <stdio.h>
2. intmain()
3. {
4. inti=0;
5. while(i<3)
6. i++;
7. printf("In while loop\n");
8. }
a) 2 b) 3 c) 4 d) 1
1. #include <stdio.h>
2. voidmain()
3. {
4. int x =5;
5. if(x <1)
6. printf("hello");
7. if(x ==5)
8. printf("hi");
9. else
10. printf("no");
11. }
a) hi b) hello c) no d) none
1. #include <stdio.h>
2. intx;
3. voidmain()
4. {
5. if(x)
6. printf("hi");
7. else
8. printf("how are u");
9. }
a) hi b) how are you c) hi how are you d) hello
3) A_____________character instructs the computer to move the control to the next line.
5) Local variable which exists and retains its value even after the control is transferred to
the calling function is_____________ storage class.
6) An _____________ storage class can be used to declare global variable known to all
the functions in theprogram.
13) The _____________ operator can be used to determine the length of variable
according to its data type in bytes.
14) Determine the value of the following logical expression when x=10, y=15 and z=20.
Expression Result
15) The standard mathematical functions are included in the_____________ header file.
17) In C, language _____________ checks whether the input value of the argument c is
an alphabet or not.
18) An immediate exit from the loop can be achieved by a ------------ statement.
19) Which format specifier is used to print the values of double type variable _________.
20) C programs are converted into machine language with the help of _____________.