In: Computer Science
Need the correct line of code for c program to solve this equation . i is a value that the program all ready calculates from user imput. t
i = (x*1000)+(y*500)+(z*250
I have written the program using C PROGRAMMING LANGUAGE.
OUTPUT :
CODE :
//included the stdio library
#include <stdio.h>
//main method
int main(void) {
//declared the variables of double type
double i,x,y,z;
//Taking the user inputs for x,y and z values
printf("Enter value for x : ");
scanf("%lf",&x);
printf("Enter value for y : ");
scanf("%lf",&y);
printf("Enter value for z : ");
scanf("%lf",&z);
//i = (x*1000)+(y*500)+(z*250)
i = (x*1000)+(y*500)+(z*250);
//To print the output on the console
printf("\nOUTPUT : \nThe value of i is %lf",i);
return 0;
}
Thanks..