What will be the output of the following code?
int x = 5;printf("%d", ++x);
4
5
6
7
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
return
static
new
volatile
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
Bjarne Stroustrup
James A. Gosling
Dennis Ritchie
Dr. E.F. Codd
int
float
include
char
N=m=0
Value+=10
mySize=x<y?9:11
Value=+=10
is executed only once if the conditions is true
is also known as entry-controlled loop
is executed at least once if the conditions is false
the unconditional loop
exit
break
continue
Call by reference
Call by value
Call by reference by passing base address to a function
Both A and C
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
Constants
Keywords
Operators
Tokens
signed short
unsigned short
long
10
20
0
None
Compiler
Interpreter
Assembler
None of These
for loop
while loop
do-while loop
None of the above
Return
GOTO
Switch
Spaces
Digits
Underscores
Letters
2
1
Depends on the system
2 bytes
4 bytes
8 bytes
1 byte
float_int, keyword, A1
ANSI, ascii, cpu
valid, variable, name
<
=
>=
<=
-1
Depends on array size
fclose()
closefile()
fileclose()
endfile()
void
endl
switch
Algorithm
Flow-Charts
Procedural
Object Oriented
LowerCase letters
UpperCase letters
CamelCase letters
None of these
What is the output of the following code?
int arr[5] = {1, 2, 3, 4, 5};printf("%d", arr[3]);
3
8
char str[] = "Hello";
char str = "Hello";
string str = "Hello";
char str[] = {'H', 'e', 'l', 'l', 'o'};
*
&
%
#
What will be the output of the following pseudo code ?
Integer aSet a =4do print a + 2 a = a-1while (a not equals 0)end while
6 6 6 6
6 5 4 3
6 7 8 9
6 8 10 12
int number;
float rate;
int variable_count;
int $main;
start()
printf()
main()
getch()
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.
none of the above
real
double
It returns the size of the variable in bits
It returns the size of the variable in bytes
It returns the size of the variable in kilobytes
It returns the number of elements in an array
C compiler supports octal integer constant.
C compiler supports hexadecimal integer constant.
C compiler supports binary integer constant.
C compiler supports decimal integer constant.
for (i=1; i < 20; i++) printf ("k");
for (i=1; i = 20; i++) printf ("k");
for (i=0; i < 20; i++) printf ("k");
for (i=0; i <= 20; i++) printf ("k");
30
32
36
40
world
addition23
test-name
factorial
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, double
short int, double, long int
float, double, long double
double, long int, float
int func();
func() int;
function int func();
declare int func();
strlen()
sizeof()
length()
strlength()
How many times will the following loop execute?
int j;for(j = 1; j <= 10; j = j-1)printf("INFOMAX");
Forever
Never
Input data
The program does not require any function.
Output data
The program must have at least one function.
scanf()
getche()
gets()