How to make simple calculator in C Program......?????

Leave a Comment

  I am using this C language to make simple calculator. Using int don't get actual value of ans so I used float here. 


Input :-

#include<stdio.h>
#include<conio.h>
void main()
{
float a,b,c,d,e,f;
clrscr();
printf("enter a");
scanf("%f",&a);
printf("\n enter b");
scanf("%f",&b);
c=a+b;
printf("\nans of c is %f",c);
d=a-b;
printf("\nans of d is %f",d);
e=a*b;
printf("\nans of e is %f",e);
f=a/b;
printf("\nans of f is %f",f);
getch();
}



Output :-



0 comments:

Post a Comment