c程序以打印的整数(用户输入的)-捕鱼10元起上10元下

了解这个例子中,你应该具有知识的下列 c程序 的主题:

  • c变量,常量和文本
  • c数据的类型
  • c输入输出(i/o)

程序打印的整数

#include 
int main() {   
    int number;
   
    printf("enter an integer: ");  
    
    // reads and stores input
    scanf("%d", &number);
    // displays output
    printf("you entered: %d", number);
    
    return 0;
}

运行代码

output

enter an integer: 25
you entered: 25

in this program, an integer variable number is declared.

int number;

then, the user is asked to enter an integer number. this number is stored in the number variable.

printf("enter an integer: ");
scanf("%d", &number);

finally, the value stored in number is displayed on the screen using printf().

printf("you entered: %d", number);

本文来自投稿,不代表亲测学习网立场,如若转载,请注明出处:http://www.qince.net/c-print.html

郑重声明:

本站所有内容均由互联网收集整理、网友上传,并且以计算机技术研究交流为目的,仅供大家参考、学习,不存在任何商业目的与商业用途。 若您需要商业运营或用于其他商业活动,请您购买正版授权并合法使用。

我们不承担任何技术及捕鱼10元起上10元下的版权问题,且不对任何资源负法律责任。

如遇到资源无法下载,请点击这里失效报错。失效报错提交后记得查看你的留言信息,24小时之内反馈信息。

如有侵犯您的捕鱼10元起上10元下的版权,请给我们私信,我们会尽快处理,并诚恳的向你道歉!

(0)
上一篇 2023年10月12日 上午12:05
下一篇 2023年10月12日 下午8:18

猜你喜欢

网站地图