WorksheetsBasic testing
Total questions: 25
Worksheet time: 25mins
Who is the father of C language?
Steve Jobs
James Gosling
Rasmus Lerdorf
none of these
Among the following Datatypes , Which Datatype stores integer value but gives wider range of values at the cost of taking more memory?
float
double
long double
long
which keyword among the following can be used for both variables and functions?
static
unsigned
typedef
union
What will be the output of the following code snippet?
#include <stdio.h>
int main()
{
int a = 3, b = 5;
int t = a;
a = b;
b = t;
printf("%d %d", a, b);
return 0;
}
3 3
3 5
5 3
5 5
Which of the following is an exit controlled loop?
do while loop
for loop
while loop
none of these
Which is valid C expression?
int my_num = 100,000;
int my_num = 100000;
int my num = 1000;
int $my_num = 10000;
Which bitwise operator is suitable for turning on a particular bit in number?
&& operator
& operator
|| operator
| operator
what is the output of this c code?
#include<stdio.h>
int main()
{
int i = 5;
i = i / 3;
printf("%d\n" , i );
return 0;
}
Implementation defined
3
1
compile time error
what is the output of this c code?
#include<stdio.h>
int main()
{
int i = -3;
int k = i % 2;
printf("%d\n" , k );
return 0;
}
none of these
-1
1
compile time error
what is the output of this c code?
#include<stdio.h>
void main()
{
int k = 8 ;
int x = 0 == 1 && k++;
printf("%d%d\n", x , k );
}
0 8
0 9
1 9
1 8
what is the output of this c code?
#include<stdio.h>
void main()
{
unsigned int = -9;
printf("%d", x );
}
1
9
-9
compiler error
what is the output of this c code?
#include<stdio.h>
int main()
{
int x = 2 , y = 3 ;
x / = x / y;
printf("%d\n", x );
return 0;
}
none of these
1
2
compiler error
what would be the value of c?
#include<stdio.h>
int main ( )
{
int h ;
float a,b;
a= 245.08;
b= 78.03;
c = a + b;
}
333.02
323.98
error
323
When do you need to use type-conversions?
The value to be stored is beyond the max limit
The value to be stored is in a form not supported by that data type
To reduce the memory in use, relevant to the value
All the above
Which type of conversion is NOT accepted?
From float to char pointer
From negative int to char
From double to char
All the above
Choose correct C while loop syntax
while(condition); { //statements }
{ //statements }while(condition)
while(condition) { //statements }
none of these
What is the output of C Program.?
int main()
{
while(true)
{
printf("RABBIT");
break;
}
return 0;
}
compiler error
run time error
no output
RABBIT
int main()
{
int k;
for(k=1; k <= 5; k++);
{
printf("%d ", k);
}
return 0;
}
what is the output ?
1 2 3 4 5
5
6
syntax error
What is the way to suddenly come out of or Quit any Loop in C Language.?
continue; statement
break; statement
leave; statement
quit; statement
Which of the following operators has an associativity from Right to Left?
<=
<<
+=
==
Comment on the following statement.
n = 1;
printf("%d, %dn", 3*n, n++);
none of these
Output will be 3, 1
Output will be 6, 1
Output is compiler dependent
which of the followings set are correct form of datatype, variable and constants combination.
void,_main,099
int, main_name, xyz
none of these
varchar,jkd,3ai
Is the following statement correct?
Break statement is used in "for loop".
true
false
A C program is basically a collection of-----------.C language is well suited for------------programming.
program, platform oriented
rules, dynamic
codes, simple
function, structure
Is the following statement correct?
Goto statement can be used anywhere in the program to jump from its current execution to some other lines in the code
true
false
