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

来源:互联网 发布:ubuntu dash 删除 编辑:程序博客网 时间:2024/04/21 00:15

/* 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:


0 0
原创粉丝点击