C Programming - Control Instructions
Why should I learn to solve C Programming questions and answers section on "Control Instructions"?
Learn and practise solving C Programming questions and answers section on "Control Instructions" to enhance your skills so that you can clear interviews, competitive examinations, and various entrance tests (CAT, GATE, GRE, MAT, bank exams, railway exams, etc.) with full confidence.
Where can I get the C Programming questions and answers section on "Control Instructions"?
IndiaBIX provides you with numerous C Programming questions and answers based on "Control Instructions" along with fully solved examples and detailed explanations that will be easy to understand.
Where can I get the C Programming section on "Control Instructions" MCQ-type interview questions and answers (objective type, multiple choice)?
Here you can find multiple-choice C Programming questions and answers based on "Control Instructions" for your placement interviews and competitive exams. Objective-type and true-or-false-type questions are given too.
How do I download the C Programming questions and answers section on "Control Instructions" in PDF format?
You can download the C Programming quiz questions and answers section on "Control Instructions" as PDF files or eBooks.
How do I solve C Programming quiz problems based on "Control Instructions"?
You can easily solve C Programming quiz problems based on "Control Instructions" by practising the given exercises, including shortcuts and tricks.
#include<stdio.h>
int main()
{
int x;
for(x=-1; x<=10; x++)
{
if(x < 5)
continue;
else
break;
printf("IndiaBIX");
}
return 0;
}
#include<stdio.h>
int main()
{
int j=1;
while(j <= 255)
{
printf("%c %d\n", j, j);
j++;
}
return 0;
}
The while(j <= 255) loop will get executed 255 times. The size short int(2 byte wide) does not affect the while() loop.
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.
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
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.