Can one please spot my mistake, I know I've been a annoying user but the reason why I am because my knowledge of programming was zero till I started the course at my uni and I am doing much better than before for sure but more works needed for me.
#include
#include
char s1[80], s2[80];
int i;
int main (){
strcpy(s1, "cat");
i=0;
while(s1[i]!='\0'){
s2[i]=s1[i];
i++i
}
s2[i]=\0;
}


VulpesRank #55 · 29.2K reputationPosted Aug 13, 2012, 7:57 AM EDT
printf(s2);
at the end so you need to add that line to check it's working properly
Nattudurai EswaramurthyRank #5,536 · 296 reputationPosted Aug 12, 2012, 11:06 PM EDT
Could you please try the below code:
#include
#include
char s1[80], s2[80];
int i;
int main (){
strcpy(s1, "cat");
i=0;
while(s1[i]!='\0'){
s2[i]=s1[i];
++i;
}
s2[i]='\0';
}
sami sam39 reputationPosted Aug 12, 2012, 11:27 PM EDT
d.c:13:2: warning: no newline at end of file
was not working too.
VulpesRank #55 · 29.2K reputationPosted Aug 13, 2012, 1:02 AM EDT
sami sam39 reputationPosted Aug 13, 2012, 6:35 AM EDT