C Programming - Control Instructions

Why C Programming Control Instructions?

In this section you can learn and practice C Programming Questions based on "Control Instructions" and improve your skills in order to face the interview, competitive examination and various entrance test (CAT, GATE, GRE, MAT, Bank Exam, Railway Exam etc.) with full confidence.

Where can I get C Programming Control Instructions questions and answers with explanation?

IndiaBIX provides you lots of fully solved C Programming (Control Instructions) questions and answers with Explanation. Solved examples with detailed answer description, explanation are given and it would be easy to understand. All students, freshers can download C Programming Control Instructions quiz questions with answers as PDF files and eBooks.

Where can I get C Programming Control Instructions Interview Questions and Answers (objective type, multiple choice)?

Here you can find objective type C Programming Control Instructions questions and answers for interview and entrance examination. Multiple choice and true or false type questions are also provided.

How to solve C Programming Control Instructions problems?

You can easily solve all kind of C Programming questions based on Control Instructions by practicing the objective type exercises given below, also get shortcut methods to solve C Programming Control Instructions problems.


How many times "IndiaBIX" is get printed?

int main()
    int x;
    for(x=-1; x<=10; x++)
        if(x < 5)
    return 0;

A. Infinite times
B. 11 times
C. 0 times
D. 10 times

Answer: Option C


No answer description available for this question. Let us discuss.


How many times the while loop will get executed if a short int is 2 byte wide?

int main()
    int j=1;
    while(j <= 255)
        printf("%c %d\n", j, j);
    return 0;

A. Infinite times
B. 255 times
C. 256 times
D. 254 times

Answer: Option B


The while(j <= 255) loop will get executed 255 times. The size short int(2 byte wide) does not affect the while() loop.


Which of the following is not logical operator?

A. &
B. &&
C. ||
D. !

Answer: Option A


Bitwise operators:
& is a Bitwise AND operator.

Logical operators:
&& is a Logical AND operator.
|| is a Logical OR operator.
! is a NOT operator.

So, '&' is not a Logical operator.


In mathematics and computer programming, which is the correct order of mathematical operators ?

A. Addition, Subtraction, Multiplication, Division
B. Division, Multiplication, Addition, Subtraction
C. Multiplication, Addition, Division, Subtraction
D. Addition, Division, Modulus, Subtraction

Answer: Option B


Simply called as BODMAS (Brackets, Order, Division, Multiplication, Addition and Subtraction).

Mnemonics are often used to help students remember the rules, but the rules taught by the use of acronyms can be misleading. In the United States the acronym PEMDAS is common. It stands for Parentheses, Exponents, Multiplication, Division, Addition, Subtraction. In other English speaking countries, Parentheses may be called Brackets, or symbols of inclusion and Exponentiation may be called either Indices, Powers or Orders, and since multiplication and division are of equal precedence, M and D are often interchanged, leading to such acronyms as BEDMAS, BIDMAS, BODMAS, BERDMAS, PERDMAS, and BPODMAS.

For more info: http://en.wikipedia.org/wiki/Order_of_operations


Which of the following cannot be checked in a switch-case statement?

A. Character
B. Integer
C. Float
D. enum

Answer: Option C


The switch/case statement in the c language is defined by the language specification to use an int value, so you can not use a float value.

switch( expression )
    case constant-expression1:    statements 1;
    case constant-expression2:    statements 2;    
    case constant-expression3:    statements3 ;
    default : statements 4;

The value of the 'expression' in a switch-case statement must be an integer, char, short, long. Float and double are not allowed.