'm new to c can someone help me out i'm trying to write a program that reverses each letter in a sentence. eg - going home = gniog emoh. but i keep getting strange char's heres the code:
Code:#include<stdio.h> int main() { char info[100]; char temp; int i = 0; int n; int j = 0; int count; printf("Enter info to encrypt: \n"); scanf("%[^\n]s", info); while(info[n] != '\0') { n = 0; while(info[j] != ' ') { j++; } count = j; printf("%d", j); while(i <= count) { temp = info[i]; info[i] = info[j]; printf("%c", info[i]); info[i] = temp; j--; i++; } j = count; j++; if(info[j] == ' ') { n = info[j]; printf("%c", n); j++; } n++; } return 0; }