Hi,
The attached image below is from my mock exam. This is the first code i have written from scratch so there may be a simple error (but im hoping not)!
Is this the correct way of solving this problem?
Code:#include <stdio.h>
int i=0, c=0;
char line[10]="Fantastic";
int main(void);
{
if (i<10)
{
if (c=='\0');
{
printf("\n");
}
else
{
print("%c",c);
c=line[i++];
}
}
else
{
printf("\n");
}
return 0;
}