Font size
WorksheetsC Basic Data Types & Operators
Total questions: 110
Worksheet time: 6hrs 8mins
Who is know as founder of C language
Dennis Ritchie
Bjarne Stroustroup
Tim Berner Lee
Rasmus Ledorf
Which of these is not a correct variable data type?
int
float
real
char
C is a
Low level language
Assembly language
Medium level language
High level language
Which punctuation ends most of the lines of C code?
.
;
,
" "
The starting point of C execution at
==
main()
function()
!=
Type four arithmetic operators sorting by their operation name *without space(like addition a first, so '+')
(a)
What do you think is the best way to enhance your skill in programming
Study Hard
Practice
Practice and learn new
Study one day and leave it
Prewritten packages are imported to program by using which symbol
Hint: Header Files
%
-
#
//
Find if the condition is True or False where int x=10; y=12;
x == y
1 (True)
0 (False)
Find if the condition is True or False where int x=10; y=12;
x < y
1 (True)
0 (False)
What do you think is the output for the below code snippet?
int main(){
int a=10,b=20;
printf("%d", b/a);
}
Error
0.2
2
30
What do you need to import stdio.h a header file?
Just a waste of time
To run the code
It helps in compilation to binary coded file
To perform input and output operations
Which of the following operator(s) is/are used for assigning a value?
==
=
+=
!=
#include <stdio.h>
int main() {
int i = 0;
int j = i++ + i;
printf("%d\n", j);
}
0
1
2
Compile time error
printf is a
function
variable
datatype
operator
#include <stdio.h>
int main()
{
int i = 2;
int j = ++i + i;
printf("%d\n", j);
}
What is the output of the above program?
4
5
6
7
#include <stdio.h>
int main()
{
int a = 2;
int b= a >> 1;
printf("%d\n", b);
}
0
1
2
Compile time Error
#include <stdio.h>
int main()
{
int a = 2;
int b= a << 1;
printf("%d\n", b);
}
1
2
3
4
#include <stdio.h>
int main()
{
int a = 2;
int b=11 ;
printf("%d\n", a+b*a);
}
26
24
20
None
#include <stdio.h>
int main()
{
int a = 10, b = 5, c = 5;
int d;
d = b + a % c;
printf("%d", d);
}
7
5
0
Compile time error
#include <stdio.h>
int main()
{
int a = 10, b = 5, c = 5;
int d;
printf("%d", a==(b+c)? 100 :-100);
}
100
-100
Compile time error
1
Which of the following is false statement about C program?
All valid C programs must contain the main() function.
The code execution begins from the start of the main() function.
To use printf() in our program, we need to include stdio.h header file using #inclue <stdio.h> statement.
The printf() is a library function to read formatted input to the screen
format specifier of a float number is
%c
%d
%f
%x
int main ()
{
int x = 24, y = 39, z = 45;
z = x + y;
y = z - y;
x = z - y;
printf ("n%d %d %d", x, y, z);
}
24 39 63
39 24 63
24 39 45
39 24 45
C Language is developed at ___________?
AT & T's Bell Laboratories of USA in 1972
AT & T's Bell Laboratories of USA in 1970
Sun Microsystems in 1973
Cambridge University in 1972
C programs are converted into machine language with the help of
An Editor
A compiler
An operating system
None of these.
Which one of the following is not a valid identifier?
_examveda
1examveda
exam_veda
examveda1
Which is the only function all C programs must contain?
start()
system()
printf()
main()
Program is a list of_______________, written in a _______________________ to determines the behaviour of a machine.
word, english
instructions , programming language
instructions, word
A flowchart is a graphical representation that helps programmer to develop algorithms in programming.
True
False
#include<stdio.h> is important line in c. The stdio.h contains information on input output routines.
True
False
The operator "&" is used for
Bitwise AND
Bitwise OR
Logical AND
Logical OR
The size of a character variable in C is
8 bytes
4 bytes
2 bytes
1 byte
___ is used to translate source code instructions into the appropriate machine language instructions
Module
Library routine
Compiler
Preprocessor directives
A ____ is a set of instructions that the computer follows to solve a problem.
Comipler
Linker
Program
Operator
The program written by the programmer with high level language is called:
Object Code
Syntax
Source Code
Runtime Library
What is the extension of C program source code?
.cpp
.py
.c
.java
What is machine language?
A language used by car
Machine language is made of 1's and 0's
Machine language is made of 7's and 8's
A language that only understands plain English
Which of the following is not a high level programming language?
Assembly
C++
Java
Python
The words if, else, auto, float etc. have predefined meaning and users cannot use them as variables.
These words are called
keywords
identifier
data types
constant
C language is a
structured program
object oriented program
oriented program
basic program
What function is use to display a message?
printf
output
Symbolic constants are defined in (a) section.
All variables used in the program are declared in (a) part of main function.
user defined functions are contained in (a) section.
int x;
int y;
int z;
x=3;
y=4;
z = ++x * y++;
printf("%d",z);
12
16
20
0
int main()
{
int a = 25%10;
printf("%d", a);
return 0;
}
5
2
2.5
5.5
The modulus operator (%) can be used only with integers.
True
False
!= is the example of ____________________ operator.
Relational
Logical
Assignment
Conditional
++ and -- are unary operators.
True
False
The _____________ operator checks if the value of left operand is greater than the value of right operand.
= =
<
>
=
#include <stdio.h>
int main()
{
int i = 95;
char c = 97;
printf("%d, %d\n", sizeof(i), sizeof(c));
return 0;
}
2,1
4,2
2,4
2,8
#include <stdio.h>
void main()
{
int x = 5 * 9 / 3 + 9;
}
24
3
23
4
Select the data types that can be used with the % operator.
int
float
double
all of the above
What is the output of the given code?
Error
10 20 30
10 20 1
10 200 1
What is the output of the given code?
Error
10 20 30
10 20 1
10 200 1
What is the value of 'a' in the following statement?
int a = 10 + 10.55;
Error
20.55
20
Can't be defined
What is the output of the given code?
10 10
10 100
100 100
10 20
None of the above
int x;
int y;
int z;
x=3;
y=4;
z = ++x * y++;
printf("%d",z);
12
16
20
0
Which of the following is not a Bitwise operator?
&
|
<<
&&
What is the output of the following printf
printf("%d",34+24/12%3*5/2-4);
35
-2
34
38
What is the output of the following code:
#include<stdio.h>
void main()
{
int a=10,b=80,c=45;
printf("%d",a<b>c);
}
0
1
10
Error
What is the output of the following code:
#include<stdio.h>
void main()
{
int a=10,b=-5;
printf("%d",a&&b);
}
1
0
Error
10
-5
What is the output of the following printf
int a=-11;
printf("%d",!a);
0
1
12
10
What is the output of the following printf:
printf("%d",14%-4);
2
-2
3
0
What is the output of the following printf:
int a=10;
b=++a;
printf("%d,%d",a,b);
11,11
10,11
11,10
10,10
What is the output of the following printf:
int a=1,2,3,4;
printf("%d",a);
1
2
3
4
Compile time error
What is the value of printf:
printf("%d",sizeof(double));
8
10
4
6
What is the output of the following printf:
int a=10,b=3;
printf("%d",a<<b);
80
0
20
40
What is the output of the following printf:
int a=20,b=15;
printf("%d",a|b);
31
20
1
35
What is the output of the following code snippet:
int a=12;
a?printf("GEC"):printf("IT");
GEC
IT
GECIT
Error
What is the output of the following printf:
printf("%d",10<400>300>40);
0
1
Error
400
What is the value of X in the sample code given below?
X = ( 2 + 3) * 2 + 3;
10
13
25
28
What value will be stored in z if the following code is executed?
x = 5 , y = -10, a = 4, b = 2;
z = x+++++y * b/a;
-2
0
1
2
Which operators are used to compare the values of operands to produce logical value in c language?
Logical operator
Relational operator
Assignment operator
None of the above
Which operators perform operations on data in Binary level?
Bit wise operator
Logical operators
Arithmetic operator
All of the Above
What is/are the number of operand/operands needed to unary operator logical not(!)?
4
3
2
1
When applied to a variable, what does the unary "&" operator yield?
The variable's address
The variables right value
The variable's binary form
The variable's value
A name having a few letters,numbers and special character _(underscore) is called
Keywords
reserved words
Identifier
None of the above
The operator "&" is used for
Bitwise AND
Bitwise OR
Logical AND
Logical OR
The size of a character variable in C is
8 bytes
4 bytes
2 bytes
1 byte
Operators means
symbols
signals
codes
things
C support a rich set of _____ operators.
user-defined
other-defined
built-in
system-defined
Operators tells the computer to perform certain _______ or_______ manipulations.
Mathematical
logical
relational
assignment
What are the types of operators?
arithmetic and logical
relational and assignment
bitwise and special
conditional and increment/decrement
___________ operator is used to construct mathematical expression.
relational
bitwise
arithmetic
logical
___________ operator is used to compare two quantities.
relational
logical
assignment
bitwise
___________ operator is used to form compound conditions by combining two or more relations
relational
logical
assignment
bitwise
Symbols of relational operators
+ - * / %
< > <= >= == !=
&& || !
All
11/4
2
3
2.0
3.0
11.0/4
2
2.75
3
3.0
If x=5,
Then x+=10 is evaluated.
What is the value of x?
25
10
15
5
5<=5 evaluates to
true
false
99%9
0
1
10
15
Select the assignment operator
==
===
=
!=
ASCII value of the character 'd'
99
100
101
97
10/3%2
2
1.56
10
1
15/(3+4)*8
37
16
0
72
5-10+3
which operation will be performed first?
addition
subtraction
Operator % in C Language is called.?
Percentage Operator
Quotient Operator
Modulus
Division
Output of an arithmetic expression with integers and real numbers is ___ by default.?
Integer
Real number
Depends on the numbers used in the expression.
None of the above
int a = 3.5 + 4.5;
0
7
8
8.0
What is the other name for C Language ?: Question Mark Colon Operator.?
Comparison Operator
If-Else Operator
Binary Operator
Ternary Operator
In C, the result of the conditional operator is ____________.
true
false
1
0
The output of an arithmetic expression with integer and float is __________.
int
float
can't be defined
operation not possible
