6
#include <stdlib.h>
#include <stdio.h>
int main()
{
int i,j;
char elenco[30];
while(elenco[i]!='s' || i<=20)
{
printf("indique um menbro do elenco ,se quiser sair escreva apenas a letra S");gets(elenco);
i++;
}
for(j=1;j<=i;j++)
{
printf("Elenco.:%-30s\n",elenco[j]);
}
}
I want the cycle while
continue until the character is entered S
or until introduced 20 times
Apparently because you didn’t initialize the value of
i
– Amanda Lima
i=0 resolve then?
– Kira
Probably solve.
– Amanda Lima
still equal any other idea? xD
– Kira
Always start your local variables.
– Daniel Grillo