C compiler supports octal integer constant.
C compiler supports hexadecimal integer constant.
C compiler supports binary integer constant.
C compiler supports decimal integer constant.
Addition, Division, Modulus
Addition, Modulus, Division
Multiplication, Substration, Modulus
Modulus, Multiplication, Substration
What is the output of the following code?
int a = 10, b = 5;printf("%d", a / b);
5
2
0.5
15
What will be the output of the following code?
int main(){int x,y,z;x='1'-'0'; /* line-1 */y='a'-'b'; /* line-2 */z=x+y;printf("%d",z);}
0
Error because of incorrect line-1 only.
Error because of incorrect line-1 and line-2.
Error because of incorrect line-2 only.
start()
printf()
main()
getch()
put together the file and functions that are required by the program
translate the instructions into a form suitable for execution by the program
load the executable code into the memory and execute them
allow the user to type the program
compare two numeric values
combine two numeric values
compare two boolean values
None of the above
int a = 10, b = 20;printf("%d", a + b);
30
1020
10+20
Compiler error
To determine which operator evaluated first from left to right.
To determine the level of an operator in a program.
To determine how an expression involving more than one operator is evaluated.
To check the expression is valid or not.
What will be the output of the following program?
int main() { int x=5; printf(“%d %d %d”,x,x<<2,x>>2); }
1 20 5
5 1 20
5 20 1
20 1 5
float_int, keyword, A1
ANSI, ascii, cpu
valid, variable, name
The basic data type of C
Qualifier
Short is the qualifier and int is the basic data type
All of the mentioned
They execute programs faster than compilers
They translate the entire program at once
They translate and execute code line by line
They are not used in modern programming
scanf()
getche()
gets()
*
+
++
&&
char > int > float
int > char > float
char < int < double
double > char > int
auto
case
main
default
4
1
Depends on the system
Logical Operator
Conditional Operator
typecast
Ternary
<
=
>=
<=
link, load, code, compile and execute
code, compile, link, execute and load
code, compile, link, load and execute
compile, code, link, load and execute
Keywords can be used as variable names
Variable names can contain digits
Variable names do not contain blank spaces
Capital letters can be used in variable names.
What will be output if you compile and execute the following ‘C’ code?
void main(){int i=4,x;x=++i + ++i + ++i;printf("%d",x);}
21
18
19
Compilation error
int my_num = 100,000;
int my_num = 100000;
int my num = 1000;
int $my_num = 10000;
Find the output of following code :
int main() { int i=-2; printf (“-i=%d”,-i); return b; }
–i=2
i=-2
–i=-2
–i=+2
It is used to define global variables
It is used to define a macro
It is used to include standard or user-defined header files in the program
It is used to include comments in the code
Martin Richards
Dennis Ritchie
Ken Thompson
Herman Hellorith
float
double
long double
far double
main(){ int a, b; a=b=4; b=a++; printf("%d %d %d %d", a++, --b, ++a, b--);}
5 3 7 3
Syntax error
5 4 5 3
6 2 6 4
* / % + - =
= * / % + -
/ * % - + =
* % / - + =
results in a syntax error
output Infomax7
outputs garbage
outputs infomax and terminates abruptly
int x = 5;printf("%d", ++x);
6
7
LowerCase letters
UpperCase letters
CamelCase letters
None of these
Assignment Relational Arithmetic
Arithmetic Relational Assignment
Relational Arithmetic Assignment
Assignment Arithmetic Relational
void
endl
switch
32
36
40
N=m=0
Value+=10
mySize=x<y?9:11
Value=+=10
2 bytes
4 bytes
8 bytes
1 byte
immutable
mutable
const
volatile
print()
input()
All of the above
Undefined
When the following piece of code is executed, what happens?
b = 3;a = b++;
a contains 3 and b contains 4
a contains 4 and b contains 4
a contains 4 and b contains 3
a contains 3 and b contains 3
world
addition23
test-name
factorial
What will be output if you will compile and execute the following c code?
int main(){ int a=5; float b; printf("%d",sizeof(++a+b)); printf(" %d",a); return 0;}
2 6
4 6
2 5
4 5
Constants
Keywords
Operators
Tokens
Either True or False
is less than or is more than
is equal or less or more
//
/
#
/*
Compiler
Interpreter
Assembler
None of These
final
constant
static
int a = 5;printf("%d", a == 5);