Saturday, 27 December 2014

C Program for performing Arithematic Operations



This is basic program for all starters. It simply takes two integer numbers adds , subtracts , multiples and divides them.

PROGRAM :

#include <stdio.h>
#include <stdlib.h>
int main()
{
 float a,b,c,d,e,f;
 printf("Enter first number:  \t" );
 scanf("%f", &a);
 printf("Enter another number:  \t" );
 scanf("%f",&b);

 c=a+b;
 d=a-b;
 e=a*b;
 f=a/d;
 
 printf("\n Sum of two numbers %f and %f is : %f \n",a,b,c );
 printf("\n Difference of two numbers %f and %f is : %f \n",a,b,d );
 printf("\n  Product of two numbers %f and %f is : %f \n",a,b,e );
 printf("\n Division of two numbers %f and %f is : %f \n",a,b,f );
 return 0;
} 
OUTPUT :


C - Arithematic Operations