Answer to Question #84049 in C for Muha

Question #84049
• Create or find 3 files containing C programs such as the one given below
#include <stdio.h>
struct time {
int hour,min;
};
typedef struct {
int flightno;
struct time arrival;
}FlightInfo;

void inp(FlightInfo arr[]){
int i;
for (i=0;i<2;i++)
{
printf("Enter flight no and arrival time:");
scanf("%d %d %d",&arr[i].flightno,&arr[i].arrival.hour,&arr[i].arrival.min);}}
void calculateDelay(FlightInfo arr[], int d){
int i,x;
for (i=0;i<2;i++) {
• For the three C programs,
◦ Read the file name from the user and open the file
◦ Read the C program from the text file and find the
▪ number of statements in the program
▪ number of for, while and do-while loops in the program
Output
Sample Run:
Program named “flights.cpp” contains:
53 lines of code
3 for loops
2 while loops
1 do-while loop
Program named “hw.cpp” contains:
45 lines of code
1 for loop
3 while loops
0 do-while loop
1
Expert's answer
2019-01-10T05:41:11-0500
The answer to the question is available in the PDF file https://www.assignmentexpert.com/https://www.assignmentexpert.com/homework-answers/programming-answer-84049.pdf

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