使用比较运算符比较具有相同值的int和float变量时会发生什么?
main( )
{
int x = 3 ;
float y = 3.0 ;
if ( x == y )
printf ( "\nx and y are equal" ) ;
else
printf ( "\nx and y are not equal" ) ;
}
output : x and y are equal
What happens when x is compared with y variable?
Run Code Online (Sandbox Code Playgroud) int main() {
int i,j,count;
count=0;
for(i=0; i<5; i++);
{
for(j=0;j<5;j++);
{
count++;
}
}
printf("%d",count);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
如果我们放在这里;在 for() 之后 for 循环不运行任何东西。那么程序执行完后count是怎么变成1的呢?