• This program is written in C. • This program prints “there hi ” • You must mod
ID: 3829473 • Letter: #
Question
• This program is written in C.
• This program prints “there hi ”
• You must modify this program so that it prints “hi there ”
• IMPORTANT: You may only add code at the “// your code here” section. You may add as many lines as necessary, but NO EXISTING CODE CAN BE MODIFIED (this also means no new functions can be added).
• IMPORTANT: All printing must be done through the existing printf calls; you may not add your own calls to any output functions (printf, putchar, etc).
• HINT: This assignment can be completed in one line.
#include
void a();
void b();
void c();
int main() {
a();
printf(" ");
return 0;
}
void a() {
b();
printf("hi ");
}
void b() {
c();
printf("there ");
}
void c() {
int x;
// your code here
}
Explanation / Answer
#include
void a();
void b();
void c();
int main() {
a();
printf(" ");
return 0;
}
void a() {
b();
printf("hi ");
}
void b() {
c();
printf("there ");
}
void c() {
char x[]="hi there";
printf("%s",x);
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.