Sunday, November 6, 2016

Advantages and Disadvantages of C Language

C Language Advantages

  • C is compiler based language; hence programmers can compile their program to check for any errors.
  • C programming is easy to learn for the beginners.
  • C language provides lot of in-built library functions.
  • C is portable language. C executable program can be executed on other similar systems.
  • C supports many arithmetic, logical, relational and bitwise operators.
  • C provides good functionalities for System level programming. Many operating systems are developed using C language. UNIX was developed using C language.
  • Low-level access to computer memory is possible using C language.
  • C supports user defined function development.
  • C provides good Graphics support.
C Language Disadvantages

  • C is not an object oriented language; hence C does not support any Object Oriented Programming (OOP) concepts like Inheritance, Encapsulation and Polymorphism.
  • C language does not support any exception handling.
  • C does not support any runtime error checking mechanism.
  • C does not provide support for namespace like C++.


* * * * *

Friday, November 4, 2016

Answer of MCQs based on C programming Expression evaluation

C programming Expression evaluation - Answers

Associativity of ++, -- and ! Operators in expressions evaluation are from ________.
A. left to right
B. right to left
C. none of these
ANSWER: B

An arithmetic expression without parenthesis will be evaluated from left to right using rules of precedence of operators.
A. True
B. False
C. None of these
ANSWER: A

In C programming, the statement a=a+1 and a+=1 will produce same result.
A. True
B. False
C. None of these
ANSWER: A

All the variables in expressions must be assigned values before evaluation is attempted.
A. True
B. False
C. None of these
ANSWER: A

Associativity of + and - Operators in expressions are from ________.
A. left to right
B. right to left
C. none of these
ANSWER: A

In C programming, the statement a=a*(n+1) and a=*n+1 will produce same result.
A. True
B. False
ANSWER: B

In a pretest loop if the body is executed n times the test expression is executed n+1 times.
A. True
B. False
C. None of these
ANSWER: A

Within an expression, __________ precedence operators will be evaluated first.
A. higher
B. lower
C. none of these
ANSWER: A

The __________ represents which operator should be evaluated first if an expression is containing more than one operator with same priority.
A. Priority
B. Associativity
C. none of these

ANSWER: B


MCQs based on C programming Expression evaluation


Associativity of ++, -- and ! Operators in expressions evaluation are from ________.
A. left to right
B. right to left
C. none of these

An arithmetic expression without parenthesis will be evaluated from left to right using rules of precedence of operators.
A. True
B. False
C. None of these

In C programming, the statement a=a+1 and a+=1 will produce same result.
A. True
B. False
C. None of these

All the variables in expressions must be assigned values before evaluation is attempted.
A. True
B. False
C. None of these

Associativity of + and - Operators in expressions are from ________.
A. left to right
B. right to left
C. none of these

In C programming, the statement a=a*(n+1) and a=*n+1 will produce same result.
A. True
B. False

In a pretest loop if the body is executed n times the test expression is executed n+1 times.
A. True
B. False
C. None of these

Within an expression, __________ precedence operators will be evaluated first.
A. higher
B. lower
C. none of these

The __________ represents which operator should be evaluated first if an expression is containing more than one operator with same priority.
A. Priority
B. Associativity
C. none of these


* * * * *

Thursday, November 3, 2016

MCQs based on Branching Statements of C Programming Language


Which of the following is branching statement of C language?
A. if statement
B. if…else statement
C. switch statement
D. All of these

____________ is the built in multiway decision statement in C.
A. for
B. switch
C. if
D. while

The default case is compulsory in the switch case statement.
A. True
B. False
C. None of these

if and switch statements are examples of control statements in C.
A. True
B. False
C. None of these

Case label in switch statement must be constants only.
A. True
B. False

The break statement is optional in the switch-case statement
A. True
B. False
C. None of these

It is not permitted to nest a switch statement
A. True
B. False
C. None of these

A program stops its execution when break statement is encountered.
A. True
B. False
C. None of these

If the Boolean expression of if statement evaluates to ________, then the block of code inside the if statement will be executed.
A. True
B.  False
C.  None of these

C programming language assumes any non-zero and non-null values as true.
A. Statement is True
B.  Statement is False


MCQs with answer - Branching Statements of C Programming Language


Which of the following is branching statement of C language?
A. if statement
B. if…else statement
C. switch statement
D. All of these
ANSWER: D

____________ is the built in multiway decision statement in C.
A. for
B. switch
C. if
D. while
ANSWER: B

The default case is compulsory in the switch case statement.
A. True
B. False
C. None of these
ANSWER: B

if and switch statements are examples of control statements in C.
A. True
B. False
C. None of these
ANSWER: A

Case label in switch statement must be constants only.
A. True
B. False
ANSWER: B

The break statement is optional in the switch-case statement
A. True
B. False
C. None of these
ANSWER: A

It is not permitted to nest a switch statement
A. True
B. False
C. None of these
ANSWER: B

A program stops its execution when break statement is encountered.
A. True
B. False
C. None of these
ANSWER: B

If the Boolean expression of if statement evaluates to ________, then the block of code inside the if statement will be executed.
A. True
B.  False
C.  None of these
ANSWER: A

C programming language assumes any non-zero and non-null values as true.
A. Statement is True
B.  Statement is False
ANSWER: A 

Answer of MCQs based on C Operators.

Which of the following is example of relational operator in C language?
A. <
B. >
C. !=
D. All of these
ANSWER: D

All arithmetic operators have the same level of precedence.
A. True
B. False
C. None of these
ANSWER: B

The _____________ operator checks if the value of left operand is greater than the value of right operand.
A. = =
B. <
C. >
D. =
ANSWER: C

++ and -- are unary operators.
A. True
B. False
C. None of these
ANSWER: A

!=   is the example of ____________________ operator.
A. Relational
B. Logical
C. Assignment
D. Conditional
ANSWER: A

An arithmetic expression without parenthesis will be evaluated from left to right using rules of precedence of operators.
A. True
B. False
C. None of these
ANSWER: A

Which of the following is not a bitwise operator?
A. &
B. <<
C. >>
D. *
ANSWER: D

The _____________ operator checks if the values of two operands are equal.
A. = =
B. =
C. !=
ANSWER: A

The modulus operator (%) can be used only with integers.
A. True
B. False
C. None of these
ANSWER: A

The __________ operator checks if the value of left operand is greater than or equal to the value of right operand.
A. <=
B. >=
C. !=
ANSWER: B


MCQs based on C operators

Which of the following is example of relational operator in C language?
A. <
B. >
C. !=
D. All of these

All arithmetic operators have the same level of precedence.
A. True
B. False
C. None of these

The _____________ operator checks if the value of left operand is greater than the value of right operand.
A. = =
B. <
C. >
D. !=

++ and -- are unary operators.
A. True
B. False
C. None of these

!=   is the example of ____________________ operator.
A. Relational
B. Logical
C. Assignment
D. Conditional

An arithmetic expression without parenthesis will be evaluated from left to right using rules of precedence of operators.
A. True
B. False
C. None of these

Which of the following is not a bitwise operator?
A. &
B. <<
C. >>
D. *

The _____________ operator checks if the values of two operands are equal.
A. = =
B. =
C. !=

The modulus operator (%) can be used only with integers.
A. True
B. False
C. None of these

The __________ operator checks if the value of left operand is greater than or equal to the value of right operand.
A. <=
B. >=
C. !=
D. None of these



* * * * *