They can contain alphanumeric characters as well as special characters
It is not an error to declare a variable to be one of the keywords(like goto, static)
Variable names cannot start with a digit
Variable can be of any length
An array of characters
The object of some class
Same as other primitive data type
Linkedlist of characters
for (int i = 0; i < 10; i++)
for i = 0 to 10 step 1
for (i = 0; i < 10; i++)
for (i < 10; i++)
scanf()
getch()
getche()
gets()
void
endl
float
switch
link, load, code, compile and execute
code, compile, link, execute and load
code, compile, link, load and execute
compile, code, link, load and execute
C compiler supports octal integer constant.
C compiler supports hexadecimal integer constant.
C compiler supports binary integer constant.
C compiler supports decimal integer constant.
exit
break
continue
return
print("Hello World");
echo("Hello World");
printf("Hello World");
None of these
arr[4]
arr(5)
arr[5]
arr[6]
“programming Trick”
“programming"
‘programming'
$ programming $
* / % + - =
= * / % + -
/ * % - + =
* % / - + =
Decimal
Binary
Octal
Hexadecimal
float, double
short int, double, long int
float, double, long double
double, long int, float
Value of elements in array
First element of the array
Base address of the array
Address of the last element of array
LowerCase letters
UpperCase letters
CamelCase letters
What is the output of the following code:
int x = 5;
printf("%d", x++);
4
5
6
Undefined
2.5
2
2.000000
2.500000
for loop
while loop
do-while loop
none of the above
It breaks out of both loops.
It only breaks out of the innermost loop.
It causes a compile-time error.
It stops the program.
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.
int func();
func() int;
function int func();
declare int func();
4 Bytes
8 Bytes
Depends on the system/compiler
Cannot be determined
*
&
%
#
pair of parenthesis
semicolon
braces
colon
auto
case
main
default
is executed only once if the condition is true.
is also known as entry-controlled loop.
is executed at least once if the condition is false.
is unconditional looping statement..
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
conio.h
string.h
math.h
graphic.h
Compilation error
Program will terminate with an error
Undefined behavior
Array index will wrap around
char str[] = "Hello";
char str = "Hello";
string str = "Hello";
char str[] = {'H', 'e', 'l', 'l', 'o'};
What is the final value of x when the code is executed?
int x; for(x=0; x<10; x++) {}
10
9
1
3
Depends on the system
do-while
if-else
for
while
A
B
ADA
C++
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
Assignment Relational Arithmetic
Arithmetic Relational Assignment
Relational Arithmetic Assignment
Assignment Arithmetic Relational
"r"
"w"
"rw"
"read"
Moves the file pointer to a specific location
Reads a file
Writes to a file
Closes a file
<
=
>=
<=
char
int
double
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
An Editor
A compiler
An operating system
A number
A special symbol other than underscore
Both of the above
An alphabet
static
new
volatile
-5
+5
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
it Compare the variable a and the variable b are same.
The value of b is assigned to variable a but if b changes later, it will not effect the value of variable a.
The value of b is assigned to variable a but if b changes later, it will effect the value of variable a.
The value of variable a is assigned to variable b, and the value of variable b is assigned to variable a.