Question: Write comment after every sentence explaining the code Write ( Input Process - Output ) for the code C code: #include #include int main() {

Write comment after every sentence explaining the code

Write ( Input Process - Output ) for the code

C code:

#include #include int main() { int flag=1,len,i,j,sz; char str[100]; while(flag) { printf(" Enter a string: "); scanf("%s",str); len=strlen(str); printf("Printing string forward:"); i=0; while(i { printf("%c",str[i]); i++; } printf(" Printing string backward:"); i=len-1; while(i>=0) { printf("%c",str[i]); i--; } printf(" Printing string vertically:"); i=0; while(i { printf(" %c",str[i]); i++; } printf(" Printing string as a triangle: "); i=0; j=2; i=0; while(i { printf("%c",str[i]); if(i==0) { printf(" "); sz+=j; } if(i==sz) { printf(" "); sz+=j; } j++; i++; } printf(" Do you want to continue press 1/0"); scanf("%d",&flag); } }

output:

Write comment after every sentence explaining the code Write ( Input Process

EAc prog devistring manipulation.exe Enter a string: abcdef Printing string forward:abcde-f Printing string backward:fedcba Printing string vertically: 2 Printing string as a triangle: bc def Do you want to continue press 1/ee Process exited after 20.83 seconds with return value e Press any key to continue 6 8

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!