我的问题可能很简单,但我想知道这个x + 1是什么意思?我们来看一个例子:
int main()
{
int x = 2;
x + 1; //1
if ((x - 2) && (x = 7)) { //2 and 3
// do something
}
}
Run Code Online (Sandbox Code Playgroud)
我知道的:
问题:
我在调试器中看到这不会改变x的值,但我在Visual Studio中使用C++编译器,因此它可以提供另一个值.
提前致谢 :)
练习30
编写一个程序,读取以十进制扩展名开发的浮点值
记住数据控制
这是没有关于整数类型的消息的新消息.
#include <stdio.h>
#include <math.h>
int main(){
double x; //the argument of f(x)
printf("Program demands x");
printf("\nand writes the rounded value\n");
printf("Author: xXx\n\n");
//loading data
printf("Write x in float type in decimal extension "); // after many tries, program is not rounding the value
if (scanf("%lf",&x)!=1 || getchar()!='\n'){
printf("Wrong data.\n");
printf("\nEnd of program.\n");
return 0;
}
double round( double x );
printf( "Rounded value is = %lf\n", x);
printf("\nEnd of program.\n");
return 0;
}
Run Code Online (Sandbox Code Playgroud)