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

Trending Topics

Online now

Members online
1,101
Guests online
1,494
Total visitors
2,595

Forum statistics

Threads
2,294,318
Posts
29,090,258
Members
1,207,270
Latest member
hatefuld13
Back
Top