What's new

C & C++ Patulong sa C, Bug bato?

I am nobody

Forum Guru
Joined
Jan 30, 2016
Posts
4,160
Solutions
2
Reaction
4,967
Points
1,825
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
 

Similar threads

Back
Top