Answer to Question #263955 in C for Toxic king

Question #263955

Write a program that allows the user to enter the coal usage at a power station for the first and second week of October in metric tonnes which is as follows:



Week 1: 29,31,29,30,30,28,35



Week 2: 33,37,28,32,31,30,32

1
Expert's answer
2021-11-10T10:04:47-0500
#include<stdio.h>
int main(){
	int week1[7];
   int week2[7];
   int i, j, k,n;
   for(i=0; i<7; i++){
   	printf("Day %d\n", (i+1));
   	scanf("%d", &week1[i]);
   }
   
   for(j=0; j<7; j++){
   	printf("Day %d\n", (j+1));
   	scanf("%d", &week2[j]);
   }
   printf("Week 1 :");
   for(k=0; k<7; k++){
   	printf(" %d  ", week1[k]);
   
   }
   printf("\nWeek 2 :");
   for(n=0; n<7; n++){
   	printf("%d  ", week2[n]);
   }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS