🔒 Closed Patulong sa C, Bug bato?

Status
Not open for further replies.

I am nobody

Forum Guru
Pag character ang inside the for loop hindi bumabasa in alternate, see code below.

[CODE lang="c" title="C"]#include<stdio.h>

int main()
{
int i,n=5;

char x[5];

for(i=0;i<n;i++)
{
printf ("Enter Letters: ");
scanf("%c",&x);
}


printf ("Letters are: \n");
for(i=0;i<n;i++)
{

printf("%c",x);
}
return 0;
}[/CODE]

check nyo.. hindi gumagana yung scanf in alternating.

di sya ganyan pag integer ang nasa scanf
 
Status
Not open for further replies.

About this Thread

  • 2
    Replies
  • 294
    Views
  • 2
    Participants
Last reply from:
I am nobody

Online now

Members online
1,062
Guests online
1,317
Total visitors
2,379

Forum statistics

Threads
2,277,060
Posts
28,974,064
Members
1,229,711
Latest member
------
Back
Top