Skip to content

Instantly share code, notes, and snippets.

@EduardoMil
Created September 30, 2015 20:07
Show Gist options
  • Save EduardoMil/7cf79d00eaab538bebf9 to your computer and use it in GitHub Desktop.
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;
#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);
}
@Geh-Oneg
Copy link

Muito bom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment