Input data
The program does not require any function.
Output data
The program must have at least one function.
world
addition23
test-name
factorial
“programming Trick”
“programming"
‘programming'
$ programming $
What is the output of the following code?
int a = 5, b = 10;if (a < b)printf("a is less than b");elseprintf("a is greater than or equal to b");
a is greater than or equal to b
a is less than b
Compiler Error
Undefined
strlen()
sizeof()
length()
strlength()
signed short
unsigned short
long
int
Consider the following code and How many bytes of memory will be allocated?
int *ptr = (int *)malloc(10 * sizeof(int));
10 bytes
20 bytes
80 bytes
40 bytes
Spaces
Digits
Underscores
Letters
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
char > int > float
int > char > float
char < int < double
double > char > int
<
=
>=
<=
A number
A special symbol other than underscore
Both of the above
An alphabet
What will be the output of following program?
int main() { for(int c=1;c<5;++c); printf(“%d”,c); }
1
5
6
12345
fclose()
closefile()
fileclose()
endfile()
Binary operator
Unary operator
Ternary operator
All of the above
&
&&
||
!
0
Infinitely
Variable
for loop
while loop
do-while loop
None of the above
AT & Ts Bell Laboratories of USA in 1972
AT & Ts Bell Laboratories of USA in 1970
Sun Microsystems in 1973
Cambridge University in 1972
*
+
++
Id_No
ID_NO
IdNo
Id No
float_int, keyword, A1
ANSI, ascii, cpu
valid, variable, name
Calm
Rough
Hard
Still
Martin Richards
Dennis Ritchie
Ken Thompson
Herman Hellorith
-5
+5
-1
2
Decimal
Binary
Octal
Hexadecimal
2.5
2.000000
2.500000
break
continue
return
None of these
30
32
36
40
getchar()
gets()
scanf()
cin.get()
-3.4e38 to 3.4e38
-32767 to 32768
-32668 to 32667
-32768 to 32767
Logical Operator
Conditional Operator
typecast
Ternary
start()
printf()
main()
getch()
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.
int a(char *s)
void b(int a[], int n)
float *c()
short d(long x)
Deriving a base class from derived class
Deriving a derived class from base class
Deriving a derived class from more than one base class
None of the mentioned
do-while
if-else
for
while
Depends on array size
Return
GOTO
Switch
exit
Raj says, “He wants ice cream”
Raj had said, “He wants an ice-cream”
Raj will say, “I want an ice-cream”
Raj said, “I want an ice-cream”
Algorithm
Flow-Charts
Procedural
Object Oriented
was doing
did
will do
have done
Compiler
Interpreter
Assembler
None of These
What will the following code print?
int x = 5;if (x = 0)printf("Zero");elseprintf("Not zero");
Zero
Not zero
Compilation error
Error
Program will terminate with an error
Undefined behavior
Array index will wrap around
Both can occur multiple times, but a declaration must occur first.
A definition occurs once, but a declaration may occur many times.
Both can occur multiple times, but a definition must occur first.
A declaration occurs once, but a definition may occur many times.
LowerCase letters
UpperCase letters
CamelCase letters
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