🔒 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
  • 306
    Views
  • 2
    Participants
Last reply from:
I am nobody

Trending Topics

Online now

Members online
820
Guests online
3,376
Total visitors
4,196

Forum statistics

Threads
2,307,524
Posts
29,179,468
Members
1,192,510
Latest member
Gokiboi21
Back
Top