Font size
WorksheetsES084 Final Exam
Total questions: 50
Worksheet time: 25mins
Which of the following is an invalid assignment operator?
A%=10;
A/=10;
A|=10
none
Who is the father of C-Language?
Steve Jobs
James Gosling
Dennis Ritche
Rasmus Lerdorf
Which of the following is not a valid C variable name?
int number;
float _rate;
int variable_Count;
int $main;
#include<stdio.h>
int main(){
int x=10;
float y = 5.6;
int c;
int z;
z = x+y;
printf("Value of z is %d", z);}
What is the value of "z" in this code?
The value of z is 10
The value of z is 15
The value of z is 15.6
The value of z is 16
What will be the output of this code?
OK
KO
Depends on compiler
Depends on standard
All keywords in C are ________.
lowercase
uppercase
Camelcase
None of these
How to write a single line comment?
/* Comment */
/* Comment
//Comment//
//Comment
_________used to give tab spaces in c programming.
/n
\t
/t
\n
The program that translates your code from a high-level language to the binary language is called ________.
programmer
compiler
translator
linker
scanf() is a predefined function of _______ header file.
stdlib.h
conio.h
stdio.h
stdarg.h
Which of the following is correct identifier?
int
1ab
a_123
a 123
what is the output of the following statement?
printf("hi\nhello\nhow\tare\ryou");
hi
hello
how are
you
hi
hello
how
are
you
hi
hello
youre
hi
hello
youare
The C-preprocessors are specified with _________ symbol.
$
#
&
*
What will be the final value of x in the following C code?
#include <stdio.h>
void main()
{
int x = 5 * 9 / 3 + 9;
}
3.75
24
3
15
What will be the output of the following C code?
#include <stdio.h>
void main()
{
int y = 3;
int x = 5 % 2 * 3 / 2;
printf("Value of x is %d", x);
}
Value of x is 1
Value of x is 3
Value of x is 1.5
Error
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int a = 10;
double b = 5.6;
int c;
c = a + b;
printf("%d", c);
}
15.6
15
16
10
What will be the output of the following C code?
#include <stdio.h>
void main()
{
int x = 1, y = 0, z = 5;
int a = (x && y) || (z++);
printf("%d", z);
}
error
5
6
0
Which among the following is NOT a logical opearator?
&&
||
!
!=
What will be the output of the following C code?
#include <stdio.h>
void main()
{
int h = 8;
int b = h++;
printf("%d%d\n", b, h);
}
8 8
8 9
9 9
9 8
The ______ symbol denotes decision making in flowchart?
The ______ symbol used for input/ output operation in flowchart?
What is the output of this program?
#include <stdio.h>
void main()
{
printf("hello\world\n");
printf("hello\n\nworld\n");
}
hello world
hello
world
hello
world
hello
world
hello
world
hello
world
hello\world
hello
world
What is the output of the following code?
void main()
{
int i=1;
i=2+2*i++;
printf("%d",i);
}
2
3
4
5
C is called ______ level programming language
Low Level
High Level
Middle
NONE
what will be output of ....
printf("%d",10+5/2);
7.5
7
12
12.5
what will be output of....
printf(" %d ", 5.6 / 2.3);
2.5
2.2
2.8
0
the % (modulus) can be used with _____ data type
double
float
int
char
logical operators are used for......
developing conditions
combining conditions
using conditions
none of the above
what will be output of following code?
int a=25;
int b=a / 10 % 10;
printf("%d",b);
25
5
2
20
what wil be output of .....
a=5; b=10;
a=a+b;
b=a-b;
a=a-b;
printf("a=%d b=%d",a,b);
a=5 b=10;
a=10 b=10
a=5 b=5
a=10 b=5
what will be output of following code:
int a;
printf("%d",&a);
display garbage value
display address of a
display 5
none of the above
printf("%d",08);will display....
8
08
10
error
if(a>b)
printf("hi");
else;
printf("hello");
if given input is 15 & 10 what will be output?
hi
hello
hi hello
ERROR
if(a>b);
printf("a is big");
else
printf(" b is big");
if input is 5 & 10 what is output?
5
10
5 10
error
The operator == is a
Conditional operator
Bitwise operator
Mathematical operator
Logical operator
Determine the output/result of the conditional expression below give the values:
a = 5, b = 8; c=8; d=3
((a+d)==b) && (c==b)
True
False
Determine the output/result of the conditional expression below give the values:
a = 5, b = 8; c=8
(a%2==0) && (c>a)
True
False
Determine the output/result of the conditional expression below give the values:
a = 5, b = 8; c=8
(a>b) && (c<a)
True
False
Determine the output/result of the conditional expression below give the values:
a = 5, b = 8; c=8
(a>b) || (c<a)
True
False
Determine the value of out for the following code snippet below:
int num = 45, n = 2.3;
float out;
out = num/n;
19.565217
19
22
22.00
Determine the value of out for the following code snippet below:
int num = 45, n = 2.3, out;
out = num/n;
19.565217
19
22
22.00
Determine the value of out for the following code snippet below:
int n = 64, m = 5, out;
out = n%m;
4
4.0
12
Error
A type of conditional structure that executes inside the body of if, only if the controlling condition is true, otherwise it will skip it and executes the statements inside the else.
if-else-if
nested if
if-else
if
A type of conditional statements best used for a problem with multiple checkpoints.
if-else-if
nested if
if-else
if
The minimum possible number of times a while loop can be executed.
0
1
cannot be predicted
depends on the compiler
A type of conditional statements best used for a problem with multiple alternatives.
if-else-if
nested if
if-else
if
Given these integer values:
A = 12, B = 16, C = 8, D = 8, E = 21, F = -12, G = -7
Evaluate:
((A<B) && (C>=D) && (F>G))
True
False
Given these integer values:
A = 12, B = 16, C = 8, D = 8, E = 21, F = -12, G = -7
Evaluate:
( !(B>D) || (!(C==D)&&(F<G)))
True
False
Given these integer values:
A = 12, B = 5, C = 18, D = 8, E = 21, F = -12, G = -7
Evaluate:
!((A%D)>=B) || ((E/B)<B)
True
False
Given these integer values:
A = 12, B = 5, C = 18, D = 8, E = 21, F = -2, G = 2
Evaluate:
(((E/B)%2)==0)
True
False
