Translate

Saturday, 22 March 2014

Make a simply calculator using Turbo c++ ( Scanf function not introduced )

Source Code :

#include<stdio.h>
#include<conio.h>
main()
{
clrscr();
  printf("\t\t\t\tCALCULATOR");
  printf("\n\t\t\t\t**********");
  printf("\n\n\tFirst # = %d  ,",12);
  printf("\tSecond # = %d",6);
  printf("\n\n\n\t\t\t    Arithmetic Operations");
  printf("\n\t\t\t    +++++++++++++++++++++");
  printf("\n");
  printf("--------------------------------------------------------------------------------");
  printf("\t* 1. Addition =");
  printf("\t\t%d+%d=\t%d",12,6,12+6);
  printf("\n\t* 2. Subtraction =");
  printf("\t%d-%d=\t %d",12,6,12-6);
  printf("\n\t* 3. Multiplication =");
  printf("\t%d*%d=\t%d",12,6,12*6);
  printf("\n\t* 4. Division =");
  printf("\t\t%d/%d=\t %d",12,6,12/6);
  printf("\n--------------------------------------------------------------------------------");

 getch();  }


In this program we simply took hard coded number for the values to be added,subtracted,multiplied and devide .




No comments:

Post a Comment