Hello to everyone.
I am trying to solve this exercise :
Enter a sentence: you can jump can't you?
Reversal of sentence: you can't jump can you?
So far , I have this code...
I must to solve it without pointers or strings. :/Code:#include <stdio.h> int main(void) { char ch , array[100]={'\0'}; int i=0 , count ; printf("Enter a sentence: "); while((ch=getchar())!='.' && ch != '?' && ch != '!' ) array[i++]=ch; for(count=0; count<i; count++) printf("%c" , array[count]); putchar(ch); // print single character printf("\n Reversal of the words of the sentence: "); for(count= i-1; count>=0; count--) { if(ch != ' ') { } } putchar(ch); return 0; }
I only want an idea..... some similar code without pointers for this.
Only with arrays.
Thank you in advance.



1Likes
LinkBack URL
About LinkBacks



