您的位置:首页 > 编程语言 > C语言/C++

给定两个正数,求他们的正差值并输出

2015-02-25 13:03 417 查看
/*
Input two numbers and output the difference of them
*/

#include <stdio.h>
#include <stdlib.h>

int main()
{
int num1,num2;
printf("Please input two numbers use a space to seperate them.\n");
scanf("%d %d",&num1,&num2);
{
int diff=abs(num1-num2);
printf("The difference of %d and %d is %d\n",num1,num2,diff);
}

return 0;
}
result:
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c语言
相关文章推荐