Professional Section
Hope you are well prepared the second level or the Professional level to claim an RC Certificate !
1.What is the output of:
#include<stdio.h>
int main()
{
int x=40;
{
int x=20;
printf("%d",x);
}
printf("%d",x);
return 0;
}
A.40 40
B.20 40
C.40 20
D.Compilation Error
2.What is the output of the following program:
void main( )
{
int i = 2, j = 3, k, l ;
float a, b ;
k = i / j * j ;
l = j / i * i ;
a = i / j * j ;
b = j / i * i ;
printf( "%d %d %f %f", k, l, a, b ) ;
}
A.3 3 2 2
B.3 3 0 2.000000
C.3 2 0.000000 3.000000
D.0 2 0.000000 2.000000
3.What is the output of:
main( )
{
int a, b ;
a = -3 - - 3 ;
b = -3 - - ( - 3 ) ;
printf ( "a = %d b = %d", a, b ) ;
}
A.-3 3
B.-6 0
C.0 -6
D.None of the Above
4. C language was developed by?
A.Dennis Richie
B.Martin Richards
C.Bill Gates
D.Ken Thompson
5.A character variable can store x characters at a time:
A.1 character
B.8 character
C.256 character
D.None of the above
6..What will the statement
char ch='A';
store in variable ch?
A.The character A
B.Ascii value of character A
C.A along with inverted commas
D.None of the above
7.What is the output of the following program?
#include <stdio.h>
int main(){
int c=08;
printf("%d",c);
return 0;
}
A.8
B.0
C.Compile Time Error
D.None of the Above
8.What is the output of the following program?
#include<stdio.h>
void main()
{
printf("%d",sizeof(5.2));
}
A.Compiler Error: Can't determine size of a constant
B.4 (Size of float)
C.8 (Size of double)
D.Garbage Value
9.What is the output of the following program?
#include<stdio.h>
int main(){
double d=5.2;
int i=5;
printf("%d\t",sizeof(!d));
printf("%d\t",sizeof(i=15/2));
printf("%d",i);
return 0;
}
A.4 2 7
B.4 4 5
C.2 2 5
D.Compile Time Error: expression not allowed inside sizeof
10.What is the output of the following program?
#include<stdio.h>
int main(){
int a= sizeof(signed) +sizeof(unsigned);
int b=sizeof(const)+sizeof(volatile);
printf("%d",a+++b);
return 0;
}
A.16
B.8
C.Error: Cannot find size of modifiers.
D.Error: Undefined operator +++.
#include<stdio.h>
int main()
{
int x=40;
{
int x=20;
printf("%d",x);
}
printf("%d",x);
return 0;
}
A.40 40
B.20 40
C.40 20
D.Compilation Error
2.What is the output of the following program:
void main( )
{
int i = 2, j = 3, k, l ;
float a, b ;
k = i / j * j ;
l = j / i * i ;
a = i / j * j ;
b = j / i * i ;
printf( "%d %d %f %f", k, l, a, b ) ;
}
A.3 3 2 2
B.3 3 0 2.000000
C.3 2 0.000000 3.000000
D.0 2 0.000000 2.000000
3.What is the output of:
main( )
{
int a, b ;
a = -3 - - 3 ;
b = -3 - - ( - 3 ) ;
printf ( "a = %d b = %d", a, b ) ;
}
A.-3 3
B.-6 0
C.0 -6
D.None of the Above
4. C language was developed by?
A.Dennis Richie
B.Martin Richards
C.Bill Gates
D.Ken Thompson
5.A character variable can store x characters at a time:
A.1 character
B.8 character
C.256 character
D.None of the above
6..What will the statement
char ch='A';
store in variable ch?
A.The character A
B.Ascii value of character A
C.A along with inverted commas
D.None of the above
7.What is the output of the following program?
#include <stdio.h>
int main(){
int c=08;
printf("%d",c);
return 0;
}
A.8
B.0
C.Compile Time Error
D.None of the Above
8.What is the output of the following program?
#include<stdio.h>
void main()
{
printf("%d",sizeof(5.2));
}
A.Compiler Error: Can't determine size of a constant
B.4 (Size of float)
C.8 (Size of double)
D.Garbage Value
9.What is the output of the following program?
#include<stdio.h>
int main(){
double d=5.2;
int i=5;
printf("%d\t",sizeof(!d));
printf("%d\t",sizeof(i=15/2));
printf("%d",i);
return 0;
}
A.4 2 7
B.4 4 5
C.2 2 5
D.Compile Time Error: expression not allowed inside sizeof
10.What is the output of the following program?
#include<stdio.h>
int main(){
int a= sizeof(signed) +sizeof(unsigned);
int b=sizeof(const)+sizeof(volatile);
printf("%d",a+++b);
return 0;
}
A.16
B.8
C.Error: Cannot find size of modifiers.
D.Error: Undefined operator +++.