Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main( void ){
- float input1, input2;
- float sum, diff, prod, quot;
- printf( "Enter the first number: " );
- scanf( "%f", &input1 );
- printf( "Enter the second number: ");
- scanf( "%f", &input2 );
- sum = input1 + input2;
- diff = input1 - input2;
- prod = input1 * input2;
- quot = input1 / input2;
- printf( "\n\nSum:\t\t%.4f", sum );
- printf( "\nDifference:\t%.4f", diff );
- printf( "\nProduct:\t%.4f", prod );
- printf( "\nQuotient:\t%.4f", quot );
- if( input1 > input2 ){
- printf( "\n\n%.4f is larger.", input1 );
- }
- else{
- printf( "\n\n%.4f is larger.", input2 );
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement