173k views
2 votes
"write a program that reads two floating point numbers and prints their sum difference and product."

User Luce
by
7.3k points

1 Answer

2 votes
int main() { float a; float b; float sum; float difference; float product; printf("enter 2 numbers"); scanf("%f%f",&a,&b); sum= a + b; difference = a - b product =a*b; printf("\\sum: %f" , sum); printf("\\difference: %f, difference); printf("\\product : %f, product ); }
User Andie Hunt
by
7.7k points