Question: Need help Current Code: #include float sum (float i, float j); void greet(int i); int main() { int a = 2031; greet(a); float x, y;
Need help
Current Code:
#include
float sum (float i, float j);
void greet(int i);
int main()
{
int a = 2031;
greet(a);
float x, y;
float su= sum(x,y);
printf("Enter two float numbers separated by ##: ");
scanf( "%f##%f", &x, &y); /* assign value to x and y */
printf( "%f + %f = %f ", x,y, sum(x,y));
return 0;
}
/* function definition */
float sum (float i, float j){
return i+j;
}
void greet(int i){
printf("Hello %d! ", i);
}
Implementation name your program lab1E.C use a loop (for or while) to interact (i.e., read input and generate output) n times, where n is entered by the user. display the two inputs with 3 decimal points, and the sum with the default format followed by 2 decimal points version Sample Inputs/Outputs: (ONE blank line between each interaction/iteration): red 338 % gcc lab1E.C -o lable red 339 % lable Hello 2031! Enter the number of interactions: 4 Enter two float numbers separated by ##: 2.35##5.64 2.350 + 5.640 = 7.990000 (7.99) Enter two float numbers separated by ##: 1.1##2.2 1.100 + 2.200 = 3.300000 (3.30) Enter two float numbers separated by ##: 1.2343##6.789 1.234 + 6.789 = 8.023300 (8.02) Enter two float numbers separated by ##: 1.2345##6.78994 1.235 + 6.790 = 8.024440 (8.02) red 340 %
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
