python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
Condition checking gives wrong answer
#include <stdio.h>
int main(){
printf("%d,%d\n", 2 & (1<<1) , 2 & (1<<1)>0 );
return 0;
}
the output of this program is 2,0.
2 & (1<<1) is equal t...
arash
Votes: 0
Answers: 1
Adding bool values
bool comapare(int val)
{
if(val>5)
{
return true;
}
return false;
}
int myFunct(int x,int y)
{
int count = 0;
count = (int)compare(x) + (int)compare(y);
return count;
}
I want...
C-ode Menon
Votes: 0
Answers: 2
How does "0.7 > a" return true where "float a = 0.7"?
Consider the code below:
float a = 0.7;
if(0.7 > a)
printf("Hi");
else
printf("Hello");
// The output will be: Hi
Why does the if statement in here return true? But if...

Ashkan Kahbasi
Votes: 0
Answers: 1
Assigning character to a character variable in a nested loop does not work in c
I'm making a code to generate a random rank for a college assignment. And the program looks like this:
#include <conio.h>
#include <ctype.h>
#include <stdbool.h>
#include <stdio.h...

Hibiki Supersanta
Votes: 0
Answers: 2