Skip to content

Instantly share code, notes, and snippets.

@savaryna
Created December 4, 2014 14:16
Show Gist options
  • Save savaryna/770c55649c55365593e0 to your computer and use it in GitHub Desktop.
Save savaryna/770c55649c55365593e0 to your computer and use it in GitHub Desktop.
#include <conio.h>
#include <stdio.h>
// calculeaza a - b daca a>b si b-a in caz contrar
void main (){
double a,b,s;
printf ("Dati valoarea lui a: ");
scanf("%lf", &a);
printf ("Dati valoarea lui b: ");
scanf("%lf", &b);
if (a>b) {
s=a-b;
printf("a > b, deci a-b=%6.3lf", s);
printf("\n");
}
else {
s=b-a;
printf("a < b, deci b-a=%6.3lf", s);
printf("\n");
}
getch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment