Created
September 30, 2015 20:07
-
-
Save EduardoMil/7cf79d00eaab538bebf9 to your computer and use it in GitHub Desktop.
um programa em C que leia dois números inteiros e mostre o resultado da diferença do maior valor pelo menor;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main (){ | |
int a,b; | |
printf ("Digite um numero "); | |
scanf ("%d",&a); | |
printf("Digite um numero "); | |
scanf ("%d",&b); | |
if (a>b){ | |
a=a-b; | |
printf ("A diferenca dos numeros digitados: %d",a); | |
} | |
else { | |
a=b-a; | |
printf("A diferenca dos numeros digitados: %d",a); | |
} | |
return (0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Gostei