Joa It Post Code - 965 C Programming Important Questions and Answers Set - 4

POOJA GUPTA
0
Joa It Post Code - 965 C Programming Important Questions and Answers Set - 4


C Programming Important Questions and Answers Set - 4


1.What will be output if you will compile
and execute the following c code?
void main(){
if(printf(“cquestionbank”))
printf(“I know c”);
else
printf(“I know c++”);
}
A. I know c
B. I know c++
C. cquestionbankI know c
D. cquestionbankI know c++
(e) Compiler error
Answer: C. cquestionbankI know c

2.What will be output if you will compile
and execute the following c code?
#define call(x) #x
void main(){
printf(“%s”,call(c/c++));
}
A.c
B.c++
C.#c/c++
D.c/c++
E. Compiler error
Answer: D. c/c++

3. What will be output if you will compile
and execute the following c code?
#define message “union is
power of c” void main(){
clrscr();
printf(“%s”,message);
getch();
}
A. union is power of c
B. union is power of c
C. union is
Power of c
D. Compiler error
E. None of these
Answer: B. union is power of c

4. What will be output if you will compile
and execute the following c code?
void main(){
int a=25;
clrscr();
printf(“%o %x”,a,A.;
getch();
}
A. 25 25
B. 025 0x25
C. 12 42
D. 31 19
E. None of these
Answer: D. 31 19

5.What will be output if you will compile
and execute the following c code?
void main(){
int i=0;
if(i==0){
i=((5,(i=3)),i=1);
printf(“%d”,i);
}
else
printf(“equal”);
}
A. 5
B. 3
C. 1
D. equal
E. None of above
Answer: C. 1

6.What will be output if you will compile
and execute the following c code?
int extern x;
void main()
printf(“%d”,x);
x=2;
getch();
}
int x=23;
A. 0
B. 2
C. 23
D. Compiler error
(e) None of these
Answer: C. 23

7.What will be output if you will compile
and execute the following c code?
void main(){
int a,b;
a=1,3,15;
b=(2,4,6);
clrscr();
printf(“%d “,a+B.;
getch();
}
A. 3
B. 21
C. 17
D. 7
E. Compiler error
Answer: D. 7

8.What will be output if you will compile
and execute the following c code?
void main(){
static main;
int x;
x=call(main);
clrscr();
printf(“%d “,x);
getch();
}
int call(int address){
address++;
return address;
}
A. 0
B. 1
C. Garbage value
D. Compiler error
(e) None of these
Answer: B. 1

9.What will be output if you will compile
and execute the following c code?
#include “string.h” void main(){
clrscr();
printf(“%d
%d”,sizeof(“string”),strlen(“string”));
getch();
}
A. 6 6
B. 7 7
C. 6 7
D. 7 6
(e) None of these
Answer: D. 7 6

10.What will be output if you will compile and execute the following c code?
void main(){
int huge*p=(int huge*)0XC0563331;
int huge*q=(int huge*)0xC2551341; *p=200;
printf(“%d”,*q);
}
A.0
B.Garbage value
C.null
D. 200
(e)Compiler error
Answer: D. 200

11. Who is father of C Language?
A. Bjarne Stroustrup
B. Dennis Ritchie
C. James A. Gosling
D. Dr. E.F. Codd
Answer: B. Dennis Ritchie

12. C Language developed at _____?
A. AT & T’s Bell Laboratories of USA in 1972
B. AT & T’s Bell Laboratories of USA in 1970
C. Sun Microsystems in 1973
D. Cambridge University in 1972
Answer: B. AT & T’s Bell Laboratories of USA in 1972

13. For 16-bit compiler allowable range for integer constants is ______ ?
A. -3.4e38 to 3.4e38
B. -32767 to 32768
C. -32768 to 32767
D. -32668 to 32667
Answer: C. -32768 to 32767

14. C programs are converted into machine language with the help of
A. An Editor
B. A compiler
C. An operating system
D. None of the above
Answer: B. A compiler

15. A C variable cannot start with
A. An alphabet
B. A number
C. A special symbol other than underscore
D. both B. and C.
Answer: D. both B. and C.

16. Which of the following is allowed in a C Arithmetic instruction
A. []
B. {}
C. ()
D. None of the above
Answer: C. ()

17. Which of the following shows the correct hierarchy of arithmetic operations in C
A. / + * – 
B. * – / +
C. + – / * 
D. * / + – 
Answer: D. * / + –

18. What is an array?
A. An array is a collection of variables that are of the dissimilar data type. 
B. An array is a collection of variables that are
of the same data type. 
C. An array is not a collection of variables that
are of the same data type. 
D. None of the above. 
Answer: B. An array is a collection of variables that are of the same data type

19. What is right way to Initialization array?
A. int num[6] = { 2, 4, 12, 5, 45, 5 } ;
B. int n{} = { 2, 4, 12, 5, 45, 5 } ;
C. int n{6} = { 2, 4, 12 } ;
D. int n(6) = { 2, 4, 12, 5, 45, 5 } ;
Answer: A. int num[6] = { 2, 4, 12, 5, 45, 5 } ;

20. An array elements are always stored in_________ memory locations. 
A. Sequential
B. Random
C. Sequential and Random
D. None of the above
Answer: A. Sequential


Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.
Post a Comment (0)
To Top