Computer Science, asked by chhotep5819, 8 months ago

A grocer has a scale of rs. S1,rs . S2, rs. S3 ,rs. S4 and rs. S5 for 5 consecutive months. How much sale must he have in the sixth month so that he gets an average sale for rs.X? Write a c program to compute the sale in the 6th

Answers

Answered by nidaeamann
0

Answer:

The cose in C language is given below

Explanation:

 #include<stdio.h>

int main()

{

 float sale[5],a;

 

 printf("Enter sale in first month\n");

 scanf("%f",&sale[0]);

 printf("Enter sale in second month\n");

 scanf("%f",&sale[1]);

 printf("Enter sale in third month\n");

 scanf("%f",&sale[2]);

 printf("Enter sale in fourth month\n");

 scanf("%f",&sale[3]);

 printf("Enter sale in fifth month\n");

 scanf("%f",&sale[4]);

 printf("Enter the average sales in 6 months\n");

 scanf("%f",&a);

 printf("The sale in the sixth month is Rs.%.2f",(6*sale[5])-(sale[0]+sale[1]+sale[2]+sale[3]+sale[4]));

 

 

 return 0;

}

Similar questions