1. R.Amutha
Assistant Professor, PSGCAS
1. Who is father of C Language?
A) Bjarne Stroustrup B) James A. Gosling C) Dennis Ritchie D) Dr. E.F.
Codd
2. C Language developed at ----------------------
A) AT & T's Bell Laboratories of USA in 1970 B) Sun Microsystems in 1973
C) Cambridge University in 1972 D) None
3. C Programs are converted into machine language with the help of -------------------
A) An Editor B) A Compiler C) An Operating System D) None
4. Which one of the following is not a reserved word in C?
A) auto B) case C) main D) int
5. Which one of the following is not a valid identifier?
A)_Studentid B) 1studentid C) Studentid D) studentid1
6. Which of the following is NOT correct in C variable type?
A) float B) real C)int d)double
7. An array elements are always stored in ----------------- memory locations.
A) Sequential B) Random C)Sequnetial & Random D)None
8. What will be printed after execution of the following code?
void main()
{
int arr[15]={1,2,3,4,5};
Printf(“%d”,arr[5]);
}
A) Garbage Value B) 0 C) 6 D) 5
9. What is the output of following code?
#include <stdio.h>
int main()
{
int i = -3;
int k = i % 2;
2. R.Amutha
Assistant Professor, PSGCAS
printf("%dn", k);
}
A) Compile time error B) 1 C) -1 d) 0
10. What will be the final value of x in the following C code?
#include <stdio.h>
void main()
{
int x = 5 * 9 / 3 + 9;
}
A) 24 B) 2 c) 4 D)Depends on compiler
11. A C variable cannot start with
A) A number B) A special symbol other than underscore C) Both A &B
D) None
12. What is the output of this C code?
void main()
{
int y = 3;
int x = 7 % 4 * 3 / 2;
printf("Value of x is %d", x);
}
A) 1 B) 4 C)0 D)3
13. The precedence of arithmetic operators is (from highest to lowest)?
A) %, *, /, +, - B) B. %, +, /, *, - C) C. +, -, %, *, / D) %, +, -, *, /
14. Which of the following is not an arithmetic operation?
A. a *= 20; B) B. a /= 30; C) C. a %= 40; D) a != 50;
15. A single line comment in C language source code can begin with-------------------
A) - B)-: C)/* D)//
16. How many main () function we can have in our program?
A) 1 (B) 2 (C) No Limit (D) Depends on Compiler
3. R.Amutha
Assistant Professor, PSGCAS
17. Which of the following is executed by Preprocess?
A) #include<stdio.h> B) return 0 (C) void main(int argc , char ** argv)
(D) None of above
18. What is the output of this C code?
void main()
{
int var = 010;
printf("%d", var);
}
A)2 B)8 C)9 D)10
19. Which of the following statements is true for variable names in C?
A) They can contain alphanumeric characters as well as special characters.
B) It is not an error to declare a variable to be one of the keywords.
C) Variable name cannot start with a digit.
D) Variable can be of any length.
20. The format identifier ‘%i’ is also used for------------data type.
A) char B)int C)float D)double
21.All Keywords in c are in-------------------
A) Lower case B)Uppercase C)Camelcase D)none
22.What will be the output of the following C Code?
#include<stdio.h>
int main()
{
j=10;
printf(“%dn”,j);;
return 0;
}
A) 10 B)11 C)Compile time error D)0
23. --------------- library function used to round up the given float value into next integer value.
A) Ceil() B) abs() c) floor() d) fabs()
4. R.Amutha
Assistant Professor, PSGCAS
24.A/An -------------------------- is an identifier that refers to a collection of data items that all
have the same name.
A) Variable B) Constant C) Array D) None
25. Which among the following is NOT a logical or relational operator?
A) != B) = = C) || D)=
26. Maximum value of unsigned integer is -----------------
A) 65535 B)32767 C)-32767 D)-65535
27. Which of the following language is predecessor to ‘C’ Programming language?
A) A B) B C) ADA D) C++
28. In the passage of text, individual words and punctuation marks are known as
A) Constants B) Operators C) Keywords D) Tokens
29. What is C Tokens?
A) The smallest individual units of c program B) The basic element recognized by the
compiler C) The largest individual units of program D) A & B Both
30. Each statement in a C program should end with ------------------
A) Semicolon ; B) Colon : C) Period . (dot symbol) D) None
31. Which of the following function compares 2 strings with case-insensitively?
A)strcmp(s, t) B)strcmpcase(s, t) C)strcasecmp(s, t) D) strchr(s, t)
32. Which among the following is odd one out?
A) printf B) fprintf C) putchar D) scanf
33. Escape sequence are prefixed with
A)% B) C)” D);
34. What is the output of this C code?
#include
void main()
{
char c = 'd';
putchar(c);
}
A) Compile time error B) d C) Undefined behaviour D)None
5. R.Amutha
Assistant Professor, PSGCAS
35. What is the purpose of sprintf?
A) It prints the data into stdout B) It writes the formatted data into a string
C) It writes the formatted data into a file D) Both A & C
36. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int const k = 5;
k++;
printf("k is %d", k);
}
A) k is 6 B) Error due to const succeeding int
C) Error, because a constant variable can be changed only twice
D) Error, because a constant variable cannot be changed
37. --------------is a conversion character used to display data item assigned decimal integer.
A) i B)f C)d D)U
38. To print out a and b given below, which of the following printf() statement will you use?
#include<stdio.h>
void main()
{
float a=3.14;
double b=3.16
}
A) printf("%f %lf", a, b); B) printf("%Lf %f", a, b);
C) printf("%Lf %Lf", a, b); D) printf("%f %Lf", a, b);
39. Data type of the controlling statement of a switch statement cannot be of the type
A) int B)char C) short D)float
40. How long the following loop runs?
for (x=0;x=3;x++)
A) Three times B) Four times C) Forever D) never
41. A switch statement is used to
A) To use switching variable
B) switch between function in a program char
6. R.Amutha
Assistant Professor, PSGCAS
C) Switch from one variable to another variable
D) Too choose from multiple possibilities which may arise due to different values of single
variable.
42. A labled statement consist of an identifier followed by a
A): B); C). D),
43. How many times the loop will be executed for the following?
for(digit=0;digit <9;digit++)
{
digit=2*digit;
digit--;
}
A) Infinite B)9 C)0 D)None
44. The continue statement cannot be used with
A) for B) while C) do while D) switch
45. Switch statement accepts.
A) int B) char C) long D) All of the above
46. Which loop is guaranteed to execute at least one time.
A) for B) while C) do while D)None
47. What is the output of this program?
#include <stdio.h>
void main()
{
int a=10;
if(a=5)
printf("YES");
else
printf("NO");
}
A) YES B) NO C) Error D)YESNO
48. Type of statement written in sequence and is repeated until specific condition met is
classified as-----
A) format B) loop C) case D) condition
7. R.Amutha
Assistant Professor, PSGCAS
49. --------- function reads character from keyboard.
A) getchar() B)getc() C)putc() D)putchar()
50. ---------- function closes an opened file.
A) fclose() B)getw() C)eof() D)feof()
51. The value of EOF is--------------
A) 0 B) -1 C) 1 D)10
52. Abbreviate ASCII with regard to C Language.
A) Australian Standard Code for Information Interchange
B) American Standard Code for Information Interchange
C) American Symbolic Code for Information Interchange
D) Australian Symbolic Code for Information Interchange
53. The ------------- statement ends the loop immediately when it is encountered.
A) break B) continue C) goto D) if
54. The ---------- statement skips the current iteration of the loop and continues with the next
iteration.
A) break B) continue C) goto D) if
55. Label in Goto statement is same like
A) Case in switch statement B) Initialization in for loop
C) Continuation condition in for loop D) All of them
56. What is the final value of x when the code int x; for(x=0; x<10; x++) {} is run?
A) 1 B) 9 C) 0 D) 10
57. How many times is a do while loop guaranteed to loop?
A) 0 B) Infinitely C) 1 D) Variable
58. Choose the correct statements
A) Array stores data of the same type B) Array can be a part of a structure
C) Array of structure is allowed D) All of the above
59. What is the output of the following?
#include <stdio.h>
void main()
{
8. R.Amutha
Assistant Professor, PSGCAS
int x=22;
if(x=10)
printf("TRUE");
else
printf("FALSE");
}
A) TRUE B) FALSE C) Compile Error D) Runtime error
59. Find the output of the following
#include<stdio.h>
int main()
{
int a=10;
if (a==10)
{
printf(“Hello…”);
break;
printf(“OK”);
}
Else
{
printf(“Hii”);
}
return 0;
A) Hello B) Hello…OK C) OK D) Error
61. Find the output of following
#include<stdio.h>
void main()
{
int ok=-100;
-100;
Printf(“%d”,ok);
}
A) 100 B) Error C) -100 d)0
9. R.Amutha
Assistant Professor, PSGCAS
Answers:
1. C 2. A 3. B 4. C 5. B
6. B 7. A 8. B 9. C 10. A
11. C 12. B 13. A 14.D 15. D
16. A 17. A 18. B 19. C 20. A
21. A 22. C 23. A 24. C 25. D
26. A 27. B 28. D 29. A 30. A
31. A 32. D 33. B 34.B 35.B
36.D 37. C 38. A 39.D 40.C
41.D 42.A 43.A 44.D 45.D
46.C 47.A 48.B 49.A 50.A
51.B 52.B 53.A 54.C 55.A
56.D 57.C 58.D 59.A 60.D
61.C