Вы находитесь на странице: 1из 8

Collection Of C Programming Question

1. Which of these syntax are correct for if construct in c? 1. if (condition) { statement; } 2. if (condition); { statement; } 3. if condition; { statement; } 1. 2. 3. 4. 1 2 3 None of above

2. BEGIN A=15 B=20 A=A+1 B=B-1 BDisplay A Display B END Identify the line that can be replaced by an increment operator wherein the final result displayed remains the same and also identify the output. 1)Line 4.output14,18 2)Line 4.output16,18 3)Line 4.output16,19 4)Line 5.output14,18 5)Line 5.output16,19 3. In case the number of value to be entered are greater then the specified limit of an array then any attempt to access any element more specified would result in 1)An Array limit Reached Error 2)An Array not specified Error 3)An Array out if bounds Error 4)System Error 4.Identify the type of array the following depicts 'Array [3][2][5][7] 1)Five dimensional array 2)Four dimensional array

3)One dimensional array 4)Three dimensional array 5)Two dimensional array 5.A two dimensional array store a series of values as a single line with each value adjacent to the other in the money. 1) False 2) True 6 .An array indexes is the number of the element that is included along with the array name for accessing values from an array. 1) False 2) True 7. Which of the following statement related to structures in c are true?(choose two)? 1) Member of a structure are accessed using the structure member variable syntax 2) Member of a structure are accessed using the structure variable member syntax 3) Structure is data type which represents different data type within the same group 4) Structure is a data type which represents only the same data type within the same group. 8. Which of those statement are correct with respect to variables? 1) A variables name should describe the kind of data in it. 2) Letter such as 0 and 1 should be avoided in variable names. 3) The first character can also include special character such as an underscore. 4) Using proper names is good method for naming variables. 5) Variables name can begin with an alphabet or number. 9. The algorithm is handed over to some other person who has not worked in the logic this method of testing is called as ........................ 1)Dry Run 2)Independent inspection 3)structured walkthrough 10. Suppose the programmer wants to print a massage "welcome", then which of the following statement are correct? 1) Printf("welcome"); 2) printf("welcome"); 3) printf('welcome'); 4) printf(welcome); 11. A variable of type int has been declared in the program, and later an alphabet (say 'A')is stored into it. What kind of an error would arise in this case? 1)Logical Error 2)Runtime Error 3)Syntax Error 12. Display below is a simple code and is presumed to be in the pseudocode format. Verify the validity of the statement. BEGIN ENTERA,B SHOW A+B
2

FINISH 1)True 2)False 13.Validate the below pseudocode BEGIN DISPLAY'LEARN PSEUDOCODE STOP 1)Error in line 1 2)Error in line 2 3)Error in line 3 4)No Error 14.Which of those declarations are correct with respect to a variables? 1)int num; 2)int Num_23 3)int_num 4)inr2num; 5)iny Num23 15.Which is the format specifies used to accept a string? 1)%C 2)%D 3)%F 4)%S 5)None of above 16.Which of the following three are 1)Boolean 2)Double 3)Float 4)Long 5)1Short 6)Unsigned derived data types in c language?

17.In ...........category, most compilers indicate the line has given rise to the error 1)Execution error 2)Logical error 3)Syntax error 18.A'rand'function calculates and returns a random integer between: a. b. c. d. -127to128 -32767to32768 0and32767 and54,576

19.Placing most frequently used statements inside a separate function: a. allows reusability of code b. helps to avoid repetition of code c. increases redundancy
3

d. reduces redundancy e. none of the above 20.To avoid unnecessary repetition of code, it is a good programming practice to; a. Place most frequently used statements inside a separate function b. Place least used statements inside a separate function c. None of above

21.'rand()'is present within the ...........library,c. a. b. c. d. < math.h> < stdio.h > conio.h stdlib.h

22.The advantages of modular approach in programming are:(choose three)? a. b. c. d. e. Easy of understanding Efficiency of maintenance of code Functions return values Repetition of code Reusability of code

23.TO terminate the current iteration and continue with the next iteration, we use 'CONTINUE Keyword. a. False b. True 24.The .........loop provides a more concise loop control structure. a. b. c. d. Do..WHILE FOR REPEAT UNTIL WHILE

25. The nice thing about using an if-else is that you have more control over the flow of the program. a. False b. True 26.The else following an if statement allows you create command blocks when the condition is true. a. False b. True

27.The .........loop repeat a statement or set of statement while a certain specified condition is true. a. Do b. Repeat?until c. While 28. In 'sorting', once the value of the first element has been compared with all the other elements in the array, it is said to have completed a/an....... a. b. c. d. 29. order session pass phase

The variable used to help in the swapping process is: a. b. c. d. e. char float int not given in the options temp

30.

Binary search requires sorting of the selected array. a. False b. True

31.

In linear search even if values in an element matches the value to be search for, the process does not end. The operation continues till all the elements are checked. a. False b. True

32.

Sorting method involves comparing the value present in the first element with each of the subsequent elements in the array a. False b. True

33.

Which of the following is the correct syntax for IF construct? 1.IF statements END IF 2.IF condition statement END IF

3.IF condition statement END IF 4.all of the above a. b. c. d. 34. 1 2 3 4

When the IF condition is evaluated to true, then the control....... a. b. c. d. comes at of the loop enter into the loop again is passed on to the statement outside its body is passed on to the statement within its body

35.

In a FOR statement, if the counter variable is not initialized, then: a. b. c. d. It is optional for the program to go into the initialization section. The program has to pass into the condition section and then into the initialization. The program has to go into the initialization section None of above

36.

Words reserved for internal use are called as a. b. c. d. Data Types Derived Data Types Keyword Variables

37.

In a DO....WHILE loop: a. b. c. d. e. It is not necessary that the loop will execute once if the condition is satisfied. The condition is evaluated at the bottom of the loop The condition is evaluated at the start before the loop executes The loop is executed at least once None of above

38.

int allows integers between............. a. b. c. d. -32767 to 32767 -32767 to32768 -32768 to 32767 -32768 to 32768

39.

When the if condition is evaluated to true, then the control........ a. b. c. d. comes out of the loop enters into the loop again is passed on the statement outside its body is passed on to the statement within its body

40.

While the IF condition is evaluated to true, then the control........ a. b. c. d. Array Array index Array type None of above

41.

The general form of a WHILE loop is: a. b. c. d. WHILE condition DO statement set Do END WHILE condition DO statement set END DO WHILE DO condition statement set Do END WHILE Do (condition) statement set Do END

42.

To exit the loop even before the test-condition fails to satisfy, We use the keyword 'CONTINUE' a. False b. True

43.

A method of algorithm writing which uses a certain standard set of words which makes it resemble code is termed as a. b. c. d. program pseudocode snippet standard function

44.

A code snippet is: a. a part of program performing an individual function b. a program that performs many functions c. a sub-program working for the main program.

45.

Which of those statements are true with respect to comparison operator? a. b. c. d. e. comparison operator always return true comparison operator are always evaluated left to right comparison operator are binary operator comparison operator can compare more then two expressions comparison operator have precedence among the other type of operators

46.

....... provides a meaningful name for some location in memory by which they can be accessed a. Flowchart b. Variables

47.

In C, sometimes to exit a loop even before the test-condition are satisfied, we use the keyword a. b. c. d. BREAK CONTINUE EXIT STOP

48.

Presanting the algorithm to a group of peers is involved in .......type of testing a. Dry run b. Independent inspection c. structured walkthrough

49. 1. 2. 3. 4.

Identify the correct syntax to accept an integer value: scanf("%d"&a"); scanf("%f";&a); scanf("%d",&a); scanf("%f"&a"); The End