that is what i am trying to do, however, the while loop only consider the first two conditions eg.
while (guess [0] == guess [1] ||guess [0] ==guess [2]), and it simply ignore those conditions...
Type: Posts; User: sfff
that is what i am trying to do, however, the while loop only consider the first two conditions eg.
while (guess [0] == guess [1] ||guess [0] ==guess [2]), and it simply ignore those conditions...
sorry maybe i haven't make myself clear,
the while loop function I wrote is suppose to execute when the element in array guess[4] are equal to each other
is that a more simple way to write this...
Hi,
i will like to assign multiple conditions for while loop with ||.
however it seems that only the first 2 conditions will be consider and other will be ignore.
So my question is how can i...
sorry but where should i put the getchar()...
i am really new to C programming
how could i "to clear the input buffer after reading your data" in this case where input always enter end the 'enter' key
i searched in the forum but cant really understand the concept~
hi lyuyangke , this is Fai from Hong Kong, nice to meet you.
it is solved
Hi I am new to C program and have the following question,
where is there is different between:
while((ch=getchar())!= '\n')
i=1;
printf("%d \n", ch);
and
because I dont know what character will be used each time, the aaaa is just for example andit could be any letter number or signs.
sorry for the confusion,
what I mean is that when I input character like "aaaaa", the program should output "-80 88 44 22" , which is bitwise rotation to the right 1 bit at a time.
yet my coding...
i cannot use array in this project,
moreover could you demonstratehowto walk downthe char using whileloop?
I am preparing a program for 8bits bitwise rotation in which the input character will shift right by one bit everytime, eg.
when input "aaa", the result will be "-80 88 44"
And then I came out...
Hi, i need to implement bitwise rotation (8 bits) (to the right) and I prepare the following
while((ch=getchar()) != '\n')
a=(ch>>1)|(ch>>(8-1));
printf("%d ", a);
however the result come...
Hi i have another question,
I wanna carry out a bit rotation (shift right to 1bits for 1st ASCII value, shift right 2bits for 2nd value and so on, until the 8th value with no bit rotation), how...
okay i see , thx
this is exactly what I needed ! Thanks !
and I guess the keyboard buffer could hold infinite keypress isn't it?
by the way what's the purpose for the 2nd ch in the statement
printf("\n %c...
I need to write a program to turn the characters inputed into ASCII value and output the value,
so i use getchar() and I encounter a problem.
Because I getchar() only allow me to input a...