Advertisement
Guest User

Kaidus

a guest
Oct 31st, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.32 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ClassesBitch
  8. {
  9.     class Program
  10.     {
  11.      
  12.         static void Main(string[] args)
  13.         {
  14.            //THIS IS THE OUTPUT, WHEN I HAVE THE Console.WriteLine outside of the while loop
  15.  // Hellooo...
  16.  // Hellooo...
  17.  // Hellooo...
  18.  // Hellooo...
  19.          
  20.  // and this is the output i get when i have the Console.WriteLine inside of the while loop
  21.  // Helloooo...
  22.            
  23.  // Helloooo...
  24.  // Helloooo...
  25.            
  26.  // Helloooo...
  27.  // Helloooo...
  28.  // Helloooo...
  29.  
  30.  
  31.  // Helloooo...
  32.  // Helloooo...
  33.  // Helloooo...
  34.  // Helloooo...
  35.  
  36.  // Helloooo...
  37.  // Helloooo...
  38.  // Helloooo...
  39.  // Helloooo...
  40.  // Helloooo...
  41.  
  42.  
  43.             string result = "";
  44.             Echo e1 = new Echo();
  45.             Echo e2 = new Echo();
  46.             int x = 0;
  47.             while (x < 5)
  48.             {
  49.                 result = result + e1.Hello() + "\n";
  50.                 e1.count=e1.count+1;
  51.                 if (x < 5) { e2.count = e2.count + 1; }
  52.                 if (x == 4) { e2.count = e2.count + e1.count; }
  53.                 x = x + 1;
  54.                 Console.WriteLine(result);
  55.                
  56.      
  57.             }
  58.            
  59.      
  60.  
  61.            
  62.         }
  63.      
  64.     }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement