14. AVERAGE SALE

Image result for c programming
Code:
  #include<stdio.h>
int main(){
  float s[5],a;

  printf("Enter sale in first month\n");
  scanf("%f",&s[0]);
  printf("Enter sale in second month\n");
  scanf("%f",&s[1]);
  printf("Enter sale in third month\n");
  scanf("%f",&s[2]);
  printf("Enter sale in fourth month\n");
  scanf("%f",&s[3]);
  printf("Enter sale in fifth month\n");
  scanf("%f",&s[4]);
  printf("Enter the average sales in 6 months\n");
  scanf("%f",&a);
  printf("The sale in the sixth month is Rs.%.2f",(6*s[5])-(s[0]+s[1]+s[2]+s[3]+s[4]));


  return 0;
}

No comments