Practice Control Instructions – Predict the output of following “C” code:
void main()
{
if(printf("O", printf("Two")))
printf("Face");
else
printf("Focus");
}
Practice Control Instructions – Predict the output of following “C” code:
void main()
{
if(printf("O", printf("Two")))
printf("Face");
else
printf("Focus");
}
Practice Control Instructions – What will be output of the following “c” code?
#include
int main() {
int i;
for(i=0;i<5;i++){
int i=10;
printf(" %d",i);
i++;
}
return 0;
}
Practice Control Instructions – What is the output of the following C Program?
#include
void main()
{
signed char i=0;
for(;i>=0;i++) ;
printf("%d
",i);
}
Practice Control Instructions – What is the output of the following C code?
#include
int main()
{
int i = 0;
for (foo(); i == 1; i = 2)
printf("In for loop
");
printf("After loop
");
}
int foo()
{
return 1;
}
Practice Control Instructions – What is the output of the following C Program?
#include
void main()
{
while(1){
if(printf("%d",printf("%d")))
break;
else
continue;
}
}
Practice Control Instructions – Consider a part of a loop as shown below.
for (i = 0; i < = 10000; i++)
{
:
:
if (error < 0.005)
break;
}
The above loop will?
Practice Control Instructions – What will be the output of the following program.
void main()
{
int c[ ]={2.8,3.4,4,6.7,5};
int j,*p=c,*q=c;
for(j=0;j<5;j++) {
printf(" %d ",*c);
++q;
}
for(j=0;j<5;j++){
printf(" %d ",*p);
++p;
}
}
Practice Control Instructions – How many times will the following loop be executed in below C program?
void main()
{
x=5;
if (x = 1) {
x++;
}
}
Practice Control Instructions – How many times will the following loop be executed if the input data item is 01234?
while (c = getchar ()! = 0) {
}
Practice Control Instructions – What will be the output of the below program?
#include
int main(){
for(printf("1");!printf("0");printf("2"))
printf("Aditya");
return 0;
}
Practice Control Instructions – The for statement which can precede a loop to be executed 50 times or till a boolean variable
Practice Control Instructions – If C is a variable initialized to 1. how many times the following loop will be executed?
while ((c > 0) && (c < 60)) {
loop body
c ++; }
Practice Control Instructions – A “switch” statement is used to
Practice Control Instructions – What is the output of the following program?
void main()
{
int B, X, Y, Z;
X=1; Y=2; Z=3;
jf ((X > 1) || (Y > 1))
if (Z > 1)
printf ("O.K /n");
else break;
if((X > 1 && (Z > 3))
printf ("Bye /n");
printf ("Hello!");
}
Practice Control Instructions – What is the output of the following problem ?
#include
int main()
{
int i;
for (i=9;i<13; i++)
printf("%d %0x ",i,i);
return 0;
}