主页
C 语言
C 变量示例
demo_variables_reallife2
运行 ❯
×
更改方向
保存代码
更改主题
#include
int main() { // Create integer variables int length = 4; int width = 6; int area; // Calculate the area of a rectangle area = length * width; // Print the variables printf("Length is: %d\n", length); printf("Width is: %d\n", width); printf("Area of the rectangle is: %d", area); return 0; }
Length is: 4
Width is: 6
Area of the rectangle is: 24