Thursday, 1 December 2016

C Language practice Question

C language (Set1)

Test

TOTAL TIME: 1 HOURS                                                                                                  TOTAL MARKS: 50
 


1. Which of the following is not a valid variable name declaration?
a) int __a3;
b) int __3a;
c) int __A3;
d) None of the mentioned
2. The format identifier ‘%i’ is also used for _____ data type?
a) char
b) int
c) float
d) double

3. What is the size of an int data type?
a) 4 Bytes
b) 8 Bytes
c) Depends on the system/compiler
d) Cannot be determined
4. loop which never stop its execution is known as
a) Invalid
b) Infinite
c) finite
d) Not applicable
5. which part of for loop initial setting  can be left empty
a) Initialization
b)Condition
c) Increment/Decrement
d) All
6. Semicolon in c language is … ?
a) Statement Terminator
b) Concatenate two statement
c) arithmetic calculation
d) None
7. Which among of following is not a logical operator
a) >
b) ==
c) =
d) !=
8. best alternative of nested if-else
a) Loop
b) Switch-case
c) array
d) expression
9. which file you can use to get your source code content back if it lost or deleted
a) flle_name.exe
b) file_name.bak
c) file_name.obj
d) all the above
10…… is used to Graphically represent logic of a program
a) flow chart
b) Symbol Logic
c) algorithm
d) Graph Logic diagram

True False
Each statement below is either TRUE or FALSE. Choose the most appropriate one and ENTER in the “OMR” answer sheet supplied with the question paper, following instructions therein. (1x10)
1. Logical operator and return true if any operand return true.
2. Element of an array is access through array name only.
3.  While loop runs at least one time when condition is false.
4. Continue jump to initial point of a loop.
5.  A character variable can be store number and perform mathematical task.
6. An array can store different data type simultaneously.
7. Prefix Increment operator is higher priority than plus operator.
8. Garbaze is predefined value which is equal to 0.
9.  A character constant always is in double quote.
10.  A keyword can also be used as identifier



Match the column
Match words and phrases in column X with the closest related meaning/word(s)/phrase(s) in column Y. Enter your selection in the “OMR” answer sheet supplied with the question paper, following instructions therein. (1x10)

Sr No.
Option
Match
1
Double
==
2
Do
8 byte
3
Index
Input a character
4
Break
10 byte
5
Constant
Can be change
6
Alt + f5
Forcefully stop
7
Getch
Output
8
Default
Cannot be change
9
Long double
Access array element
10
Logical operator
While


Big real number


Part of switch


While(condition)
;

Fill in the blank
Each statement below has a blank space to fit one of the word(s) or phrase(s) in the list below. Enter your choice in the “OMR” answer sheet supplied with the question paper, following instructions therein. (1x10)
For
Do-while
while
Less greater
scanf
puts
Stdio.h
/
%
Conio.h
printf
\n
1 or positive number
0 or negative number
=
==
Void
long
array
index

1. ……… loop decrease number of line in c program.
2 last index of an array is ----------  than from specified capacity.
3. ……… operator is used to get remainder of a number.
4. ………. Function is use to input.
5. ……… function  print new line after printing a text .
6. getch function reside in ………. Header file.
7. ………. Increase readability of a program.
8……. Or ………. Number means true.
9. ………. Operator is used to transfer a variable value to another variable.
10……….. refer unknown data type.
Written Question
(Answer any of two question from among of blow)
Q1. Write brief note on c language data type?
Q2. Write a program to take input of three marks and print total with percentage?
Q3. What do you understand by loop explain with example?

Q4. What is difference between compiler and interpreter?