PPS - Unit 1-Question Bank
PPS - Unit 1-Question Bank
PPS - Unit 1-Question Bank
UNIT I [CLO 1]
PART – A
MULTIPLE CHOICE QUESTIONS
2. C Language developed at ?
A. AT & T's Bell Laboratories of USA in 1972
B. AT & T's Bell Laboratories of USA in 1970
C. Sun Microsystems in 1973
D. Cambridge University in 1972
Ans: A
1
6. Which of the following is allowed in a C Arithmetic Instruction?
A. []
B. {}
C. ()
D. ||
Ans: C
13. The ternary conditional expression using the operator?: could be easily coded using ------------
----- statement
a) Nested if
b) if-else
c) if
d) for
Ans: b
14. The statement when executed in a switch statement causes immediate exit
from the structure.
a) goto
b) default
c) break
d) switch
Ans: c
15. Variable which uses the same name in whole program and in its all routines thus
best classified as
3
A. middle variable
B. default variable
C. local variable
D. global variable
Ans: D
16. Statement which is used to make choice between two options and only option is to be
performed is written as
A. if statement
B. if else statement
C. then else statement
D. else one statement
Ans: A
17. The statement is used to trAnsfer the control to the end of statement block in a
loop:
a. Continue
b. Break
c. Switch
d. Goto
Ans b
21. The format identifier ‘%i’ is also used for _ data type?
a) char
b) int
c) float
d) double
Ans: b
4
a. Will be stopped if one of its components evaluates to false
b. Will be stopped if one of its components evaluates to true
c. Takes place from right to left
d. Takes place from left to right
And: d
25. The following code ‘for( ; ; )’ represents an infinite loop. It can be terminated by
a) break
b) exit(0)
c) abort()
d) all of the mentioned
Ans: a
27. Which keyword is used to come out of a loop only for that iteration?
a) break
5
b) continue
c) return
d) none of the mentioned
Ans: b
33In C programming language, which of the following type of operators have the highest
precedence
a. Relational operators
b. Logical operators
c.Arithmetic operators
d.Equality operators
Ans: d
34. The solution can be reached by completing the actions in steps. These steps are called
a) Sequence
b)Algorithm
c) Flowchart
d)Steps
Ans: b
38-------------------meAns the set of instructions that make up the solution after they have been
coded into a programming language.
a) solution
b) result
c) program
d) error
Ams: c
6
b. Interpreter
c. Assembler
d.CPU
Ans: b
42. The program that converts high level language to a machine language is called
a. Interpreter
b. Linker
c. Compiler
d.Loader
Ans: c
8
56. The-----------------------statement when executed in a switch statement causes immediate exit
from the structure.
a) goto
b) default
c) break
d) switch
Ans: c
56. The ternary conditional expression using the operator?: could be easily coded using ------------
----- statement
a) Nested if
b) if-else
c) if
d) for
Ans: b
2. The ternary conditional expression using the operator?: could be easily coded using ------------
statement
a) Nested if
b) if-else
c) if
d) for
Ans:b
4. int a=10;
++a;
a++;
Printf(“%d”,a);
a) 10
b) 11
c)12
d) 13
Ans: c
9
5. int a=11;
a=a%2;
a=a/2;
printf(“%d”,a);
a) 1
b) 5
c) 0
d)0.5
Ans: c
6. #include <stdio.h>
int main()
{
int i = 3;
printf("%d", (++i)++);
return 0;
}
What is the output of the above program?
a) 3
b) 4
c) 5
d) Compile-time error
Ans: d
Ans : d
10.int main() {
int a = 1;
int b = 0;
b = a++ + a++;
printf("%d %d",a,b);
return 0;
} Find the output of the code
a) 3 6
b) Compiler Dependent
c) 3 4
d) 3 3
Ans:b
11
11. What is the output of this C code?
int main()
{
int i = -5;
int k = i %4;
printf("%d\n", k);
}
a) Compile time error
b) -1
c) 1
d) Run time error
Ans: b
Ans: c
13.#include <stdio.h>
void main()
{
int a = 3;
int b = ++a + a++ + --a;
printf("Value of b is %d", b);
}
a) Value of x is 12
b) Value of x is 13
c) Value of x is 10
d) Undefined behavior
Ans:d
a.Compilation error
b.1 2 3
c.1 2
d.1 3
Ans : b
UNIT-1 [CLO 1]
PART -C
12 MARKS
1) Explain the evolution of programming languages.
2) Explain the various steps involved in problem solving with diagram.
3) Draw the flowchart and write the algorithm and c code to find the sum and to reverse the digits
of given five-digit number.
4) Write an algorithm and draw a flow chart to find the factorial and Fibonacci series of given number.
15
16