IS it possible to use the rand function within a range, say 0 and 100?
Code:
#include<stdio.h>
#include<string.h>
#define N 30
int main(void){
char str[N];
int i,k;
scanf("%s",&str);
k=strlen(str);
for(i=k;i>=0;i--){
printf("%c",str[i]);
}
system("pause");
}
Hello, dear community.
So the problem I was proposed was to put together a code that would reverse a string this way:
ABC DEF ---> FED CBA
And the code above works fine until it reads a space character and it won't print anything past that point.
Has anyone any idea why?
Appreciate it.