Question: c Programming: CS50 I'm trying to reverse this string: Hello World! like oellH !dlroW but I don't understand how to. Using the same parameters and

c Programming: CS50

I'm trying to reverse this string: "Hello World!" like "oellH !dlroW" but I don't understand how to. Using the same parameters and for loops, no added variables

#include #include

int main(int argc, char **argv) { int i, j, k, pos;

for(i=1;argv[i]!='\0';i++) { if(!((argv[i] == ' ')||(argv[i] ==' '))) {

} else { for(k=pos;k

} for(i=0;argv[i]!='\0';i++) { if(argv[i+1]==' ' || argv[i+1]==NULL) { for(j=i;j>=0 && argv[j]!=' ';j--) { printf("%s ",argv[i]); } } printf(" "); }

return 0; }

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!