Home / C# Programming / Control Instructions - c# :: Discussion

Discussion :: Control Instructions - c#

  1. Which of the following is the correct way to rewrite the following C#.NET code snippet given below?

     int i = 0;  
     do
     {    
        Console.WriteLine(i);     
        i+ = 1; 
     } while (i 10);
    

  2. A.
     int i = 0; 
     do 
     {    
        Console.WriteLine(i); 
     } until (i 10);
    B.
    int i; 
    for (i = 0; i 10 ; i++)                
       Console.WriteLine(i);
    C.
     int i = 0; 
     while (i 11)
     {    
          Console.WriteLine(i);   
          i += 1;  
     }
    D.
     int i = 0;
     do while ( i 10)
     {     
         Console.WriteLine(i);  
         i += 1; 
     }

     

    E.
    int i = 0; 
    do until (i 10) 
    {  
        Console.WriteLine(i);  
        i+=1;  
    }

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    No answer description available for this question.


Be The First To Comment