728by90ad 
     
 
			Control Instructions Questions And Answers.  
		 
  		   
          
		   
		       Exercise ::
		       Control Instructions  
		   
		    
1. How many times "PAK-MCQS" is get printed? 
#include<stdio.h> 
int  main()
{
    int  x;
    for (x=-1 ; x<=10 ; x++)
    {
        if (x < 5 )
            continue ;
        else 
            break ;
        printf("PAK-MCQS" );
    }
    return  0 ;
} A.  Infinite times B.  11 times C.  0 times D.  10 times 
    View Answer   Discuss forum  
     Workplace      Report   
    
		
			Published by:Michael Daani  
		 2. How many times the while loop will get executed if a short int is 2 byte wide? 
#include<stdio.h> 
int  main()
{
    int  j=1 ;
    while (j <= 255 )
    {
        printf("%c %d\n" , j, j);
        j++;
    }
    return  0 ;
} A.  254 times B.  255 times C.  256 times D.  Infinite times 
    View Answer   Discuss forum  
     Workplace      Report   
    
		
		    
			   Answer:   Option  B  
Explanation:  
		    
		The while(j <= 255) while() 
  See More Information 
			Published by:Michael Daani  
		 3. 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 
    View Answer   Discuss forum  
     Workplace      Report   
    
		
		    
			   Answer:   Option  B  
Explanation:  
		    
		Simply called as BODMAS (Brackets, Order, Division, Multiplication, Addition and Subtraction).
  See More Information 
			Published by:Michael Daani  
		 4. Which of the following cannot be checked in a switch-case statement? A.  Character B.  Integer C.  Float D.  enum 
    View Answer   Discuss forum  
     Workplace      Report   
    
		
		    
			   Answer:   Option  C  
Explanation:  
		    
		The switch/case int   float   value.
  See More Information 
			Published by:Michael Daani  
		 5. Point out the error, if any in the for loop. 
#include<stdio.h> 
int  main()
{
    int  i=1 ;
    for (;;)
    {
        printf("%d\n" , i++);
        if (i>10 )
           break ;
    }
    return  0 ;
} A.  There should be a condition in the for loop B.  The two semicolons should be dropped C.  The for loop should be replaced with while loop. D.  No error 
    View Answer   Discuss forum  
     Workplace      Report   
    
		
		    
			   Answer:   Option  D  
Explanation:  
		    
		Step 1 : for(;; )Step 2 : printf("%d\n", i++); i i Step 3 : if(i>10) i for 
  See More Information 
			Published by:Michael Daani