Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#include<stdio.h> #include<conio.h> int main(void) { int a,b,sum; char c; float a1,b1,d; printf("Please enter first no.

"); scanf("%d",&a); printf("\nPlease select the operator + - / * : \n"); scanf("%s",&c); printf("\nPlease enter sencond no. "); scanf("%d",&b); if(c == '+') { sum = a + b; printf("\nthe sum of two no.s %d ",sum); } else if (c == '-') { sum = a - b; printf("\nthe result of two no.s %d",sum); } else if(c == '/') { a1=a; b1=b; d= a1 / b1; printf("\nthe result of two no.s %.3f ",d); } else if(c == '*') { sum = a * b; printf("\nthe result of two no.s %d ",sum); }

getch(); }

You might also like