String Reversal Program with Command Line Programming
C Programming Language Command Line Arguments (Article) Command Line Arguments (Program)
399Program:
// Program by atnyla // String Reversal Program with Command Line Programming #include #include #include int main(int argc, char *argv[]) { int k; char temp; int i,j=0; int strsize = 0; for (i=1; i i+1) strsize++; } char *cmdstring; cmdstring = malloc(strsize); cmdstring[0] = '\0'; for (k=1; k k+1) strcat(cmdstring, " "); } i = 0; j = strlen(cmdstring) - 1; while (i < j) { temp = cmdstring[i]; cmdstring[i] = cmdstring[j]; cmdstring[j] = temp; i++; j--; } printf("\nReverse string is :%s", cmdstring); return(0); }
Output:
Smile Reverse string is :elimS
Explanation:
Nope
This Particular section is dedicated to Programs only. If you want learn more about C Programming Language. Then you can visit below links to get more depth on this subject.