Created
December 4, 2014 14:16
-
-
Save savaryna/770c55649c55365593e0 to your computer and use it in GitHub Desktop.
This file contains 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 <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