"Write a program that takes a data line at a time and reverses the words of the line"
For example:
Input: birds and bees
Reversed: bees and birds
I'm not asking for you guys to write it for me obviously, (that kills the spirit of learning)
So here is what i have so far...
Uhhh.. am i starting off in the right direction?Code:#include <stdio.h> #include <string.h> int main() { char name[80]; printf("Input: "); fgets(name,80,stdin); printf("Reversed: %s",name); return 0; }
I tried it and it works just fine.



LinkBack URL
About LinkBacks



