Searching...
Wednesday, October 30, 2013

simple calculation in c programming

10:25 AM


It is a small program  it will help you to add two or more  numbers . It will fulfil your  demand.  
Suppose a & b are two numbers.  Here, A=22  &  b=2 then sum=24 subtract is 20. Its multiply is 44 and devided  Is 11.

#include<stdio.h>
int main()
{
    float a,b,c,d,e;
    float f;
    printf("enter two posetive number:\t");
    scanf("%f",&a);
    scanf("%f",&b);
    c=a+b;
    d=a-b;
    e=a*b;
    f=a/b;
    printf("\n sum is:%0.3f\t",c);
    printf("\n subtract is:%0.3f\t",d);
    printf("\n multiple is:%0.3f\t",e);
    printf("\n evided is lf:%0.3f\t",f);
    system("pause");
}

0 comments:

Post a Comment

Followers