C 语言添加两个整数的程序


添加两个数字的程序需要两个数字,对其进行数学求和,并将其提供给另一个变量来存储其总和。

示例代码

 实时演示

#include <stdio.h>
int main(void) {
   int a = 545;
   int b = 123;
   printf("The first number is %d and the second number is %d 
", a , b);    int sum = a + b;    printf("The sum of two numbers is %d" , sum);    return 0; }

输出

The first number is 545 and the second number is 123
The sum of two numbers is 668

更新时间:2019-07-30

971 次浏览

开启您的职业生涯

通过完成课程获得认证

立即开始
广告