Monday, August 18, 2014

A Program of Sum, Subtraction, Production and Division.

#include <stdio.h>

#include <stdlib.h>

int main()

{

int a,b,add,sub,pro;

float div;

printf("Enter 1st number: ");

scanf("%d",&a);

printf("Enter 2nd number: ");

scanf("%d",&b);

add=a+b;

sub=a-b;

pro=a*b;

div=(float)a/(float)b;

printf("\nSum=%d",add);

printf("\nSubstration=%d",sub);

printf("\nProduction=%d",pro);

printf("\nDivision=%.2f",div);

getch();

return 0;

}

No comments: