Search & Find out

Thursday, December 3, 2009

Addition, subtraction, multiplication, division & modulus

#include "stdio.h"
#include "conio.h"
void main()
{
int addition;
int a1,b1;
int subtraction;
int a2,b2;
int multiplication;
int a3,b3;
float division;
float a4,b4;
int modulus;
int a5,b5;
clrscr();
    printf("\n\nenter the values a1,b1:\n");
    scanf("%d%d",&a1,&b1);
    addition=a1+b1;
    printf("\naddition:\t%d",addition);
    printf("\n\nenter the values a2,b2:\n");
    scanf("%d%d",&a2,&b2);
    subtraction=a2-b2;
    printf("\nsubtraction:\t%d",subtraction);
    printf("\n\nenter the values a3,b3:\n");
    scanf("%d%d",&a3,&b3);
    multiplication=a3*b3;
    printf("\nmultiplication:\t%d",multiplication);
    printf("\n\nenter the values a4,b4:\n");
    scanf("%f%f",&a4,&b4);
    division=a4/b4;
    printf("\ndivision:\t%f",division);
    printf("\n\nenter the values a5,b5:\n");
    scanf("%d%d",&a5,&b5);
    modulus=a5%b5;
    printf("\nmodulus:\t%d",modulus);
    getch();
}



Download the executable (.exe)  file for this program..
download

0 comments:

Post a Comment

 

My Blog List

Term of Use