Saturday 22 September 2012

Lecture 140

                                                Lecture 140

// Loop GoTo
#include <iostream>
#include <conio.h>
using namespace std;
 main ()
{  
    int n;
    char ch;
    cout<<"Two table\n";
    n=1;
      Loop1: //Label
          ch=n;
          cout<<"\n2  X "<<n<<" = "<<2*n;
          n++;
         if(n==11) 
             goto Loop2;
         goto Loop1;
   Loop2:        
  getch();
  return 0;
}
Output:


Tuesday 11 September 2012

Lecture 139


                                                Lecture 139

// Loop GoTo
#include <iostream>
#include <conio.h>
using namespace std;
 main ()
{  
    int n;
    char ch;
    cout<<"An ASCII Table Program: \n";
    n=1;
      Loop1: //Label
          ch=n;
          cout<<n<<" = "<<ch<<"\t\t";
          n++;
         if(n==256) 
             goto Loop2;
         goto Loop1;
   Loop2:        
  getch();
  return 0;
}
Output: