C Programming Questions and Answers:: Control Instructions

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


#include
int main()
{
    int j=1;
    while(j <= 255)
    {
        printf("%c %d\n", j, j);
        j++;
    }
    return 0;
}
A. Infinite times
B. 255 times
C 256 times
D. 254 times

How many times "ExamBeat" is get printed?


#include
int main()
{
    int x;
    for(x=-1; x<=10; x++)
    {
        if(x < 5)
            continue;
        else
            break;
        printf("ExamBeat");
    }
    return 0;
}
A. Infinite times
B. 11 times
C 0 times
D. 10 times

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

A. Character
B. Integer
C Float
D. enum

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

Which of the following is not logical operator?

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

Page 1 of 2