Principles of Programming Languages 2
Principles of Programming Languages 2
MCQs [set-2]
q M
c
28. The difference between memory and storage is that memory is
M is __________.
__________________ and storage
A. temporary, permanent
B. permanent,temporary
C. slow,fast
D. all of above
Answer: A
34. What is the output of the following code? Int main(void) { char name='P';
'P'=10;return 0; }
A. name will contain value 10
B. p will contain 10
C. syntax error
D. none of these
Answer: C
35. Which of the following represents correct syntax for function declaration?
A. int sum(int,int);
B. int sum(int,int){}
36. During execution of a program the compiler demands for block of memory to
operating system.This block is called as _____________.
A. code memory
B. data memory
C. runtime storage
D. none of these
Answer: C
39. When variable used in the program is a whole number,then variable is stored
as ___________.
A. string data type
B. integer data type
C. negative whole number
D. positive whole number
Answer: B
42. What is the output of following code? #include<iostream> using namespace std;
int main() { int I; enum test{a=1,b,c,d,e,f,g,h}; for(i=c;i<=g;i++) cout<<" "<<I;
return 0; }
A. syntax error
B. 3 4 5 6 7
C. 1 2 3 4 5
D. none of these
Answer: B
44. What will be the output of the follwing code? #include<iostream> using
namespace std; int main() { float a=22.22; double b= 22.22; if(a==b)
cout<<"Matching"; else cout<<"Not Matching"; return 0; }
A. matching
B. non matching
C. syntax error
D. none of these