当前位置:网站首页>Call of addition, subtraction, multiplication and division of integer type only
Call of addition, subtraction, multiplication and division of integer type only
2022-07-25 22:11:00 【Xiaotang blog】
Encapsulate a function of addition, subtraction, multiplication and division to call
include <stdio.h>
// Repackaging function ( Three elements : Return value , parameter list , Function functions )
// Additive encapsulation
int add(int data1,int data2,int data3)
{
int result;
result=data1 + data2+data3;
return result;
}
// Subtraction encapsulation
int sub(int data1,int data2,int data3)
{
int result;
result=data1 - data2- data3;
return result;
}
// Multiplicative encapsulation
int mul(int data1,int data2,int data3)
{
int result;
result=data1 * data2 * data3;
return result;
}
// Division encapsulation
int sub(int data1,int data2,int data3)
{
int result;
result=data1 / data2 / data3;
return result;
}
int main()
{
int x;
int y;
int z;
int res;
printf(" Please enter a number :\n");
scanf("%d",&x);
printf(" Please enter another number :\n");
scanf("%d",&y);
printf(" Please enter another number :\n");
scanf("%d",&z);
res=add(x,y,z);
printf("%d+%d+%d=%d\n",x,y,z,res);
res=sub(x,y,z);
printf("%d-%d-%d=%d\n",x,y,z,res);
res=mul(x,y,z);
printf("%d*%d*%d=%d\n",x,y,z,res);
res=sub(x,y,z);
printf("%d/%d/%d=%d\n",x,y,z,res);
return 0;
}
边栏推荐
- The dragon lizard exhibition area plays a new trick this time. Let's see whose DNA moved?
- 开户就可以购买收益在百分之六以上的理财产品了吗
- Guiding principles of information security construction
- Collation of SQL statement exercises
- 信息安全建设原则指导
- YUV420 yuv420sp image format "recommended collection"
- 测试工作不受重视,你换位思考了吗?
- Redis内存淘汰机制?
- 关于接口测试你想知道的都在这儿了
- mysql: error while loading shared libraries: libncurses.so. 5: cannot open shared object file: No suc
猜你喜欢

2022 the latest software tests eight part essay. Whether you can offer depends on how you recite it

Don't vote, software testing posts are saturated

别投了,软件测试岗位饱和了...

H5幸运刮刮乐抽奖 免公众号+直运营

Ts:typera code fragment indentation display exception (resolved) -2022.7.24

How to implement an app application to limit users' time use?

Three ways to allocate disk space

H5 lucky scratch lottery free official account + direct operation

After 2 years of functional testing, I feel like I can't do anything. Where should I go in 2022?

On the difference between break and continue statements
随机推荐
突破性思维在测试工作中的应用
mysql: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No suc
C语言:随机生成数+选择排序
Redis master-slave architecture lock failure problem (master-slave)
这次龙蜥展区玩的新花样,看看是谁的 DNA 动了?
Animation curves are used every day. Can you make one by yourself? After reading this article, you will!
Output Yang Hui triangle with two-dimensional array
[fan Tan] those stories that seem to be thinking of the company but are actually very selfish (I: building wheels)
2day
C语言左值和右值说明[通俗易懂]
[go basics 02] the first procedure
ZigBee development board (nxpzigbee Development)
6-18漏洞利用-后门连接
win10搭建flutter环境踩坑日记
关于接口测试你想知道的都在这儿了
How many bytes does Boolean occupy?
Nuclear power plants strive to maintain safety in the heat wave sweeping Europe
The dragon lizard exhibition area plays a new trick this time. Let's see whose DNA moved?
What have I experienced to become a harder tester than development?
Wechat applet application development competition works comprehensive development record - Jinlu cultural tourism (cloud development - Overview)