Monday 31 December 2012

Lecture 142


                                                Lecture 142

Procedures and Functions
Code:
#include <iostream>
#include <conio.h>
using namespace std;
void Twobeep(void);    // Prototype for Twobeep();
main ()
  Twobeep();
  cout<<"Type any character\n";      
  getch();
  Twobeep();
  return 0;
}
void Twobeep()
{
  cout<<"\x7";    
  for(int i=0;i<100000;i++)
      ;     // Null Statement
  cout<<"\n";         
    
}
Code view in dev compiler:

Compile the program Ctrl+F9

      Run program Ctrl+F10

Lecture 141


                                                Lecture 141

Procedures and Functions
Code:
#include <iostream>
#include <conio.h>
using namespace std;
void Line(void);    // Prototype for Line();
main ()
  Line();
  cout<<"\xDB TITUS ANDRONICUS \xDB\n";      
  Line();
  getch();
  return 0;
}
void Line()
{
  for(int i=0;i<20;i++)
      cout<<"\xDB";
  cout<<"\n";         
    
}
Code view in dev compiler:

Compile the program Ctrl+F9

      Run program Ctrl+F10