Sail E0 Webinar

MCQs

Total Questions : 209 | Page 7 of 21 pages
Question 61. Find the output of the following program. void main() { int i=01289; printf("%d", i); }
  1.    Syntax error
  2.    713
  3.    0289
  4.    0713
  5.    1289
 Discuss Question
Answer: Option A. -> Syntax error
Question 62. Which of the following is not a correct variable type?
  1.    float
  2.    char
  3.    real
  4.    double
  5.    int
 Discuss Question
Answer: Option C. -> real
Question 63. What number would be shown on the screen after the following statements of C are executed?char ch; int i; ch = 'G'; i = ch-'A';printf("%d", i);
  1.    6
  2.    9
  3.    5
  4.    7
  5.    8
 Discuss Question
Answer: Option A. -> 6
Question 64. Find the output of the following program.void main(){ int i=065, j=65; printf("%d %d", i, j);}
  1.    053 65
  2.    065 65
  3.    65 65
  4.    53 65
  5.    Syntax error
 Discuss Question
Answer: Option D. -> 53 65
Question 65. Which of following is not a valid name for a C variable?
  1.    Exam veda
  2.    Both A and B
  3.    None of these
  4.    Exam_veda
  5.    Examians
 Discuss Question
Answer: Option A. -> Exam veda
Question 66. What is the difference between a declaration and a definition of a variable?
  1.    There is no difference between them.
  2.    A declaration occurs once, but a definition may occur many times.
  3.    A definition occurs once, but a declaration may occur many times.
  4.    Both can occur multiple times, but a declaration must occur first.
  5.    Both can occur multiple times, but a definition must occur first.
 Discuss Question
Answer: Option B. -> A declaration occurs once, but a definition may occur many times.
Question 67. Short testarray[4][3] = { {1}, {2,3}, {4,5,6}};printf("%d", sizeof(testarray));Assuming a short is two bytes long, what will be printed by the above code?
  1.    It will not compile because not enough initializers are given
  2.    12
  3.    24
  4.    6
  5.    7
 Discuss Question
Answer: Option C. -> 24
Question 68. What is right way to Initialize array?
  1.    int n(6) = { 2, 4, 12, 5, 45, 5 };
  2.    int n{6} = { 2, 4, 12 };
  3.    int num[6] = { 2, 4, 12, 5, 45, 5 };
  4.    int n{} = { 2, 4, 12, 5, 45, 5 };
 Discuss Question
Answer: Option C. -> int num[6] = { 2, 4, 12, 5, 45, 5 };
Question 69. "My salary was increased by 15%" Select the statement, which will EXACTLY reproduce the line of text above.
  1.    printf("My salary was increased by 15'%'!");
  2.    printf("My salary was increased by 15/%!");
  3.    printf("My salary was increased by 15%%!");
  4.    printf("My salary was increased by 15%!");
 Discuss Question
Answer: Option C. -> printf("My salary was increased by 15%%!");
Question 70. If ASCII value of 'x' is 120, then what is the value of the H, ifH = ('x' – 'w' ) / 3;
  1.    2
  2.    1
  3.    0
  4.    3
 Discuss Question
Answer: Option C. -> 0

Latest Videos

Latest Test Papers