-
What is the starting point of c program execution?
- #include
- void main()
- Opening curly braces '{'
- None of these
Show Answer
Answer : Option ( B ) -
C is a __________ language
- High level
- Middle level
- Machine level
- Low level
Show Answer
Answer : Option ( B ) -
What symbol ends a statement in C program?
- ; (Semicolon)
- . (full stop)
- : (Colon)
- } (curly braces)
Show Answer
Answer : Option ( A ) -
Header file is compulsory to include in a C program printing "Hello World"
- True
- False
Show Answer
Answer : Option ( A ) -
How Many Keywords are there in C?
- 31
- 32
- 64
- 63
Show Answer
Answer : Option ( B ) -
Which of the following is true for variable name in C?
- Variable names cannot start with a digit
- Variable can be of any length
- They can contain alphanumeric characters as well as special characters
- Reserved word can be used as a variable name
Show Answer
Answer : Option ( A ) -
printf() belongs to which library of c
- stdlib.h
- stdio.h
- stdout.h
- stdoutput.h
Show Answer
Answer : Option ( B ) -
Which of the following is a correct statement?
- Variable name must start with underscore
- Variable name must have digit
- variable name must have white space character
- Keyboard cannot be a variable name
Show Answer
Answer : Option ( D ) -
Any C program
- must contain at least on function
- need not contain any function
- needs input data
- none of above
Show Answer
Answer : Option ( A ) -
What should be written in the program to get newline on the screen?
- printf("\n");
- echo"\n"
- printf('\n');
- printf("\n");
Show Answer
Answer : Option ( A ) -
What is the Output?
void main() { float a=654.1239; printf("%0.3f",a); }
- Compiler error
- 654.123900
- 654.123
- 654.124
Show Answer
Answer : Option ( D ) -
Choose a C formatted Input-Output function below
- printf(), scanf()
- sprintf(), sscanf()
- printf(), fscanf()
- All of above
Show Answer
Answer : Option ( D ) -
Which operator if used to compare two values?
- Logical operator
- Relational operator
- Assignment operator
- None of these
Show Answer
Answer : Option ( B ) -
The Operator '&' is used as
- Logical AND
- Bitwise AND
- Logical OR
- Bitwise OR
Show Answer
Answer : Option ( B ) -
Which of the following is a valid relational operator?
- =
- =>
- ==
- >>
Show Answer
Answer : Option ( C ) -
What will be the value of variable a?
float a = 3.5+4.5;
- a = 8.0
- a = 8
- a = 7
- a = 0.0
Show Answer
Answer : Option ( A ) -
If we want to increment the value of sum by 1. Which of following should be used?
- sum++;
- sum = sum + 1;
- sum += 1;
- all of above
Show Answer
Answer : Option ( D ) -
What will be the value of variable a?
int a = 3.5+4.5;
- a = 0
- a = 7
- a = 8
- a = 8.0
Show Answer
Answer : Option ( C ) -
Which of the following is a valid assignment operator?
- +=
- -=
- *=
- all of above
Show Answer
Answer : Option ( D ) -
What will be the value of variable b?
Int a; int b; a=1; b = ++a;
- 1
- 2
- 3
- unknown/undefined
Show Answer
Answer : Option ( B ) -
Choose the correct statement about left shift Operator <<
- Left shift operator shits individual bits on the left side
- When shifting left side, Overflow bits are ignored
- Zeros are filled on the right side
- all of above
Show Answer
Answer : Option ( D ) -
Choose the correct statement about Right Shift Operator >>
- Right shift operator shifts individual bits on to the right side
- When shifting bits right side, overflow bits on the right are ignored or truncated
- Zeroes are filled on the left side
- all of above
Show Answer
Answer : Option ( D ) -
Which is bit toggling operator below?
- & Bitwise AND
- | Bitwise OR
- ^ Bitwise exclusive OR
- ~ Bitwise complement
Show Answer
Answer : Option ( D ) -
Left Shift operation is equivalent to __________
- Division by 2
- Multiplying by 2
- Adding 2
- Subtrating 2
Show Answer
Answer : Option ( B ) -
Which of the following is a symbol for logical AND operator?
- ||
- &
- &&
- ##
Show Answer
Answer : Option ( C ) -
Right Shift operation >> is equivalent to _________
- Multiplying by 2
- Division by 2
- Adding 2
- Subtracting 2
Show Answer
Answer : Option ( B ) -
What will be the value of variable c?
int c = 2 ^ 3;
- 1
- 8
- 9
- 0
Show Answer
Answer : Option ( A ) -
Which of the following is ternary operator?
- ??
- :?
- ?:
- ::
Show Answer
Answer : Option ( C ) -
What will be the output of following program
#include<stdio.h> void main() { int x,y=10; x = y * NULL; printf("%d",x); }
- error
- 0
- 10
- garbage value
Show Answer
Answer : Option ( A ) -
Which of following is not a valid assignment expression?
- y = 22;
- s = x;
- y%=6;
- z = 5 = 3
Show Answer
Answer : Option ( D ) -
An arithmetic expression without paranthesis will be evaluated from left to right
- True
- False
Show Answer
Answer : Option ( A ) -
In C Programming, the statement a = a+1 and a+=1 will produe same result
- True
- False
Show Answer
Answer : Option ( A ) -
Within a expression, _________ precedence operators will be evaluated first
- Similar
- Higher
- Lower
- None of these
Show Answer
Answer : Option ( B ) -
What will the value of variable a?
int a = 10 + 2 * 12 / (3*2) + 5;
- 31
- 19
- 11
- 29
Show Answer
Answer : Option ( B ) -
Which of the following correctly shows the hierarchy of arithmetic operation in C?
- /+*-
- *-/+
- /*+-
- +-/*
Show Answer
Answer : Option ( C ) -
Which is a correct 'C' expression?
- z = (x+y);
- z = [x+y]
- z = {x+y}
- z = {(x+y)};
Show Answer
Answer : Option ( A ) -
Which header file is essential for using scanf function?
- ctype.h
- string.h
- conio.h
- stdio.h
Show Answer
Answer : Option ( D ) -
Macro is used to __________________.
- Save Memory
- fast execution
- Both a & b
- none of above
Show Answer
Answer : Option ( B ) -
Which of the following is ternary operator?
- ??
- :?
- ?:
- ::
Show Answer
Answer : Option ( C ) -
Which header file is essential for using scanf() function?
- ctype.h
- string.h
- conio.h
- stdio.h
Show Answer
Answer : Option ( D ) -
A declaration float sum, value; occupies _____ of memory?
- 2 byte
- 4 byte
- 6 byte
- 8 byte
Show Answer
Answer : Option ( D ) -
MACRO is used to _______________.
- Save memory
- fast execution
- Both a & b
- none of above
Show Answer
Answer : Option ( B ) -
Which of the following is a symbol for logical AND operator?
- II
- &
- &&
- $$
Show Answer
Answer : Option ( C ) -
What will be the output of following program
#include main() { int x,y = 10; x = y * NULL; printf(\"%d\",x); }
- error
- 0
- 10
- garbage value
Show Answer
Answer : Option ( A ) -
printf() belongs to which library of c
- stdlib.h
- stdio.h
- stdout.h
- stdoutput.h
Show Answer
Answer : Option ( B ) -
What will be printed if we type the statement printf("%d\n",’d’);
- 0
- 100
- error
- d
Show Answer
Answer : Option ( B ) -
C is a __________ language
- High level
- Middle level
- Machine level
- Low level
Show Answer
Answer : Option ( B ) -
Which of the following function is more appropriate for reading in a multiword string?
- printf();
- scanf();
- gets();
- puts();
Show Answer
Answer : Option ( C ) -
What are the different types of real data types in C?
- float, double
- short int, double, long int
- double, long int, float
- float, double, long double
Show Answer
Answer : Option ( D ) -
Which of the following is a correct statement?
- Variable name must start with underscore
- Variable name must have digit
- Variable name must have white space character
- Keyword cannot be a variable name
Show Answer
Answer : Option ( D ) -
What will be the output of following code.
{ int x = 10, y=15; x = x++; y = ++y; printf("%d, %d \n" , x, y); }
- 10, 15
- 10, 16
- 11, 16
- 11, 15
Show Answer
Answer : Option ( B ) -
Any C program
- Must contain at least one function
- Need not contain any function
- Needs input data
- None of the above
Show Answer
Answer : Option ( A ) -
Which is a correct ‘C’ expression?
- z = (x+y);
- z = [x+y];
- z = {x+y};
- Z = {(x+y)};
Show Answer
Answer : Option ( A ) -
If we want to increment the value of sum by 1. Which of following should be used?
- sum++;
- sum = sum+1;
- sum += 1;
- all of above
Show Answer
Answer : Option ( D ) -
Which of following is not a valid assignment expression?
- y = 22;
- s = x;
- y % = 6;
- z = 5 = 3;
Show Answer
Answer : Option ( D ) -
What should be written in the program to get newline on the screen?
- printf("\n");
- echo "\n";
- printf(‘\n’);
- printf(" \n ");
Show Answer
Answer : Option ( A ) -
ASCII value of ‘a’ is
- 97
- 65
- 65
- None of the above
Show Answer
Answer : Option ( A ) -
A float requires ______bytes in memory
- 2 bytes
- 1 byte
- 8 bytes
- 4 bytes
Show Answer
Answer : Option ( D ) -
Which of the following operator is used to select a member of a structure variable
- .(dot)
- ,(comma)
- :(colon)
- ;(semicolon)
Show Answer
Answer : Option ( A ) -
What is the starting point of C program execution?
- #include
- void main()
- Opening curly braces ‘{‘
- None of these
Show Answer
Answer : Option ( B ) -
Which symbol ends a statement in C program?
- . (full stop)
- ; (semicolon)
- : (colon)
- } (curly braces)
Show Answer
Answer : Option ( B ) -
Which symbol is used to comment single statement?
- //
- \
- /*
- \*
Show Answer
Answer : Option ( A ) -
Why preprocessor directive needed in the beginning of a C program?
- To start execution of a program
- To include keywords in a program
- To include files in a program
- None of these
Show Answer
Answer : Option ( C ) -
Header file is compulsory to include in a C program printing "Hello World"
- True
- False
Show Answer
Answer : Option ( A ) -
Which of the following is not a basic data type in C language?
- float
- int
- real
- char
Show Answer
Answer : Option ( C ) -
How many keywords are there in C?
- 31
- 32
- 64
- 63
Show Answer
Answer : Option ( B ) -
Which of the following is true for variable names in C?
- Variable names cannot start with a digit
- Variable can be of any length
- They can contain alphanumeric characters as well as special characters
- Reserved word can be used as a variable name
Show Answer
Answer : Option ( A ) -
Character literal in C syntax is?
- Z
- ‘Z’
- "Z"
- None of these
Show Answer
Answer : Option ( B ) -
Choose the correct statement about C escape sequences
- \n produces a new line
- \t produces one tab space (white spaces)
- \b produces one backspace
- All of these
Show Answer
Answer : Option ( D ) -
Choose a valid C format specifier
- %d prints integer constants
- %f prints float constants
- %c prints character constants
- All of these
Show Answer
Answer : Option ( D ) -
What is the output?
void main() { float a=654.1239; printf("%0.3f",a); }
- Compiler error
- 654.123900
- 654.123
- 654.124
Show Answer
Answer : Option ( D ) -
Choose a C formatted Input-Output function below.
- printf(), scanf()
- sprintf(), sscanf()
- fprintf(), fscanf()
- All of these
Show Answer
Answer : Option ( D ) -
Multiple variable declarations are separated with
- Semicolon (;)
- Colon (;)
- Comma(,)
- None of these
Show Answer
Answer : Option ( C ) -
What is the other name of backslash character constants?
- Slash characters
- Space characters
- Escape sequences
- None of these
Show Answer
Answer : Option ( C ) -
Which operator is used to compare two values?
- Logical operator
- Relational operator
- Assignment operator
- None of these
Show Answer
Answer : Option ( B ) -
The operator ‘&’ is used as
- Logical AND
- Bitwise AND
- Logical OR
- Bitwise OR
Show Answer
Answer : Option ( B ) -
Which of the following is a valid relational operator?
- =
- =>
- ==
- >>
Show Answer
Answer : Option ( C ) -
What will be the value of variable a?
float a = 3.5 + 4.5;
- a = 8.0
- a = 8
- a = 7
- a = 0.0
Show Answer
Answer : Option ( A ) -
What will be the value of variable a?
int a = 3.5 + 4.5;
- a =0
- a =7
- a =8
- a =8.0
Show Answer
Answer : Option ( C ) -
Choose a right statement
int a = 5/2; int b = 5.0/2; int c = 5 / 2.0; int d = 5.0/2.0;
- a = 2, b = 2, c = 2, d= 2
- a = 2, b = 2.0, c = 2, d= 2.0
- a = 2, b = 2.5, c = 2.5, d= 2.5
- a = 2.5, b = 2.5, c = 2.5, d= 2.5
Show Answer
Answer : Option ( A ) -
Choose a right statement.
float a = 5/2; float b = 5/2.0; float c = 5.0/2; float d = 5.0/2.0;
- a=2.5, b=2.5, c=2.5, d=2.5
- a=2, b=2.5, c=2.5, d=2.5
- a=2.0, b=2.5, c=2.5, d=2.5
- a=2.0, b=2.0, c=2.0, d=2.0
Show Answer
Answer : Option ( C ) -
What will the value of variable a?
int a = 25%10;- 2.5
- 2
- 5
- Compiler error
Show Answer
Answer : Option ( C ) -
Which of the following is a valid assignment operator?
- +=
- -=
- *=
- All of these
Show Answer
Answer : Option ( D ) -
What will be the value of variable d?
int a = 10, b = 5, c = 5,d; d = b + c == a;- Syntax error
- 1
- 5
- 10
Show Answer
Answer : Option ( B ) -
What is the output?
void main() { int a = 10, b = 5, c = 3; b != !a; c = !!a; printf("%d\t%d", b, c); }- 5 1
- 0 3
- 5 3
- 1 1
Show Answer
Answer : Option ( A ) -
What will be the value of variable b?
int a; int b; a=1; b=a++;- 1
- 2
- 3
- unknown/undefined
Show Answer
Answer : Option ( A ) -
What will be the value of variable b?
int a; int b; a=1; b=++a;- 1
- 2
- 3
- unknown/undefined
Show Answer
Answer : Option ( B ) -
What will be the value of variable z?
int x=3,y=4; z = ++x * y++;- 9
- 12
- 16
- 20
Show Answer
Answer : Option ( C ) -
What will be the output?
void main() { int a=9, b=9; a=b++; printf("%d %d",a,b); }- 9,9
- 10,10
- 9,10
- 10,9
Show Answer
Answer : Option ( C ) -
Choose the correct statement about Left Shift Operator <<
- Left shift operator shifts individual bits on the left side
- When shifting left side, overflow bits are ignored
- Zeroes are filled on the right side
- All of these
Show Answer
Answer : Option ( D ) -
Choose the correct statement about Right Shift Operator >>
- Right shift operator shifts individual bits on to the right side
- When shifting bits right side, overflow bits on the right are ignored or truncated
- Zeroes are filled on the left side
- All of these
Show Answer
Answer : Option ( D ) -
Which is bit toggling operator below?
- & Bitwise AND
- Bitwise OR
- ^ Bitwise exclusive OR
- ~ Bitwise complement
Show Answer
Answer : Option ( D ) -
Left Shift operation is equivalent to____
- Division by 2
- Multiplying by 2
- Adding 2
- Subtracting 2
Show Answer
Answer : Option ( B ) -
Right Shift operation >> is equivalent to___
- Multiplying by 2
- Division by 2
- Adding 2
- Subtracting 2
Show Answer
Answer : Option ( B ) -
What will be the value of variable c?
int c = 2 ^ 3;- 1
- 8
- 9
- 0
Show Answer
Answer : Option ( A ) -
What will be the value of variable a?
int a = 6; a = ~a;- -6
- 9
- -7
- 6
Show Answer
Answer : Option ( C ) -
An arithmetic expression without parenthesis will be evaluated from left to right
- True
- False
Show Answer
Answer : Option ( A ) -
In C programming, the statement a=a+1 and a+=1 will produce same result
- True
- False
Show Answer
Answer : Option ( A ) -
Within an expression, __________ precedence operators will be evaluated first
- Similar
- Higher
- Lower
- None of these
Show Answer
Answer : Option ( B ) -
What will the value of variable a?
int a = 4 + 4/2*5 + 20;- 40
- 4
- 34
- 34
Show Answer
Answer : Option ( C ) -
What will the value of variable a?
int a = 10 + 5 * 2 * 8 / 2 + 4;- 124
- 54
- 23
- 404
Show Answer
Answer : Option ( B ) -
What will the value of variable a?
int a = 4 + 5/2*10 + 5;- 29
- 5
- 4
- 34
Show Answer
Answer : Option ( A ) -
What will the value of variable a?
int a = 10 + 2 * 12 /(3*2) + 5;- 31
- 19
- 11
- 29
Show Answer
Answer : Option ( B ) -
Which of the following correctly shows the hierarchy of arithmetic operations in C?
- / + * -
- * - / +
- / * + -
- + - / *
Show Answer
Answer : Option ( C ) -
In the following expression guess the correct order of execution of operator
z = x - y / z * 1 % 2 + 1- / * % - + =
- * / % - + =
- = / * - % +
- = / * % - +
Show Answer
Answer : Option ( A ) -
What is the output?
void main() { int i=0, j=1, k=2, m; m = i++ || j++ || k++; printf("%d %d %d %d", m, i, j, k); }- 1 1 2 3
- 1 1 2 2
- 0 1 2 2
- 0 1 2 3
Show Answer
Answer : Option ( B ) -
What is the output?
void main() { int x = 1, y = 2; printf("%d", x, y); }- 1 2
- 1
- 2
- Error
Show Answer
Answer : Option ( B )
Programming in C | MCQ | CSE101
October 18, 2021
2
Tags
Great ��, it helps me a lot
ReplyDeleteIts really helpful. After learning practicing mcq makes our topics more clear and strong.
ReplyDelete