Friday, 8 December 2017

C Language Practice Question

O level ‘C’ Language

All questions are mandatory of part 1. Each question carries 1 mark for Part 1, Part 2 marks written front of question.

Multiple Choice

1. Example of exit control loop.
(A) do-while   
(B) for
(C) while 
(D) All

2. Jump to the starting point of loop.
(A) break
(B) continue
(C) Switch   
(D) All

3. Which of the following is a valid example of built in data type?
(A) int    
(B) Char     
(C) float    
(d) All

4. Which of the following is valid example of relational operator?
(A) ==
(B) >
(C) !=    
(D) all

5. Storage capacity of long int
(A) 8     
(B) 4     
(C) 6     
(D) None

  1. / Operator is used to return remainder.
  2.  All statement of C language terminated by ;
  3. if statement cannot be reside inside of nested loop.
  4. Logical error can be detected by compiler.
  5. All variable in C language initialize by 0.

Math the column

(1) Do
(A) For
(2) ‘A’
(B) while
(3) N!
(C) int
(4) 7
(D) Armstrong
(5) Continue
(E) Char

(F) Prime

(G) Factorial

(H) Switch

(I) Used in loop

Fill in the blanks

(B) Prefix Increment
(C )Clrscr()
(D) \t
(E) Clscr()
(F) \n
(G) Postfix Increment
(H) Semi Colon
(I) ld
(J) Int
(K) Big int
(L) comma

(1) A do while loop must have ……………….. at the end.
(2) …………….. Is a special character which prints more than one space?
(3) …………… operators first use current value of variable before solving expression.
(4) ………………… function used to clear screen.
(5) …………… is used while taking input of long data type.

Part 2
Note: Attempt 3 question.

(1) Write a program to check whether a number is palindrome?
A number said to palindrome if reverse of each digit is same as input number
e.g.  17371=17371

(2)  Write a Program to check Perfect number.
A number said to perfect if sum of its entire divisor is equal to given number

Image Source Wikipedia

(3) Write down short notes on Logical and relational operator.
(4) Write a program to check whether a number is prime or not using do-while loop.

Download PDF

No comments:

Post a comment