C Programming MCQ Questions | c interview questions

C Programming MCQ Questions | c interview questions

Introduction

In this article, you will find basic to most puzzled interview queries questions. This article is very useful for those who are preparing for an interview in IT company. Whether you are experienced or

techstudy.org

Kindle Paperwhite High Resolution Display Tablet | Rs. 9999


31) What is the precedence of arithmetic operators (from highest to lowest) in C language?
  1. %, *, /, +, –
  2. %, +, /, *, –
  3. +, -, %, *, /
  4. %, +, -, *, /

⇒ Answer: (A) %, *, /, +, –

32) Which of the following is not an arithmetic operation in C?
  1. a %= 10;
  2. a != 10;
  3. a /= 10;
  4. a *= 10;

⇒ Answer: (B) a != 10;

33) Which of the following data type will throw an error on modulus operation(%) in C?
  1. float
  2. int
  3. short
  4. char

⇒ Answer: (A) float

34) Which among the following are the fundamental arithmetic operators in C?
  1. +, -, *, /, %
  2. +, -, *, /
  3. +, -, %
  4. +, –

⇒ Answer: (D) +, –

35) What will be the output of the following C code?

  1. #include <stdio.h>
  2. int main()
  3. {
  4. int num1 = 10;
  5. double num2 = 5.6;
  6. int num3;
  7. num3 = num1 + num2;
  8. printf("%d", num3);
  9. }
  10.  
  1. 10
  2. 15.6
  3. 15
  4. 0

⇒ Answer: (C) 15

     

36) Which operator from the following has the lowest priority in C language?

  1. #include <stdio.h>
  2. int main()
  3. {
  4. int num1 = 10, num2 = 5, num3 = 5;
  5. int num4;
  6. num4 = num1 == (num2 + num3);
  7. printf("%d", num4);
  8. }
  9.  
  1. 1
  2. 10
  3. 5
  4. Runtime error

⇒ Answer: (A) 1

37) Relational operators cannot be used on___________
  1. float
  2. strings
  3. long
  4. structure

⇒ Answer: (D) structure

38) Which among the following is NOT a logical or relational operator?
  1. =
  2. ||
  3. ==
  4. !=

⇒ Answer: (D) !=

39) Are logical operator sequence points?

  1. #include <stdio.h>
  2. void main()
  3. {
  4. int num1=10, num2;
  5. num2 = num1++ + ++num1;
  6. printf("%d %d %d %d", num2, num1++, num1, ++num1);
  7. }
  8.  
  1. True
  2. False
  3. Depends on the compiler
  4. Depends on the standard

⇒ Answer: (A) True

40) What is the result of a logical or relational expression in C?

  1. #include <stdio.h>
  2. void main()
  3. {
  4. int num1=10;
  5. if(num1++>9 && num1++!=10 && num1++>11)
  6. printf("%d", num1);
  7. else
  8. printf("%d", num1);
  9. }
  10.  
  1. 0 or 1
  2. True or False
  3. 0 if an expression is false and any positive number if an expression is true
  4. None of the mentioned

⇒ Answer: (B) 0 or 1

« 1 2 3 4 5

Responses




Popular Posts

Facebook

Founded in 2016, Tech Study passionately delivers stylish and dynamic innovative information to programmer & technology lovers. http://www.techstudy.org/.