Thread: C program compiler gives wrong results
hey all!!
humble salute great souls of great community!
hope me in solving below issues
problem
started learning c. run programs in terminal. following program gives me wrong result.
#include<stdio.h>
main ()
{
char in;
puts ("enter character");
in=getchar();
fflush (stdin);
if (in!='y'|| in!='y')
puts ("you did not enter y!!");
else
puts ("there entered y sweetiee!!!");
}
in program, when enter y or y, gives me result "you did not enter y!!".
going wrong??
Forum The Ubuntu Forum Community Ubuntu Official Flavours Support New to Ubuntu [SOLVED] C program compiler gives wrong results
Ubuntu
Comments
Post a Comment