In this c programming example we will learn how to print reverese words in line string
#include <stdio.h> int string_length(char s[]) { while(s[i]!='\0') return i; void string_reverse(char st[]) { j = len = string_length(st) - 1; while(i < j) { int main (void) { n = string_length(line); for(i = 0; i < n; i++) { for(j = 0; i < n && line[i]!=' '; ++i,++j) { string_reverse(temp); strcat(reverse, temp); |
Input String - C Programming Examples for beginners Reversed Words String - C gnimmargorP selpmaxE rof srennigeb |