Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main (void) {
- double num1, num2, num3, num4, num5;
- long int soma, media, prod;
- long int maior, menor;
- printf("Digite o primeiro numero:");
- scanf("%lf", &num1);
- maior=menor=num1;
- printf("Digite o segundo numero:");
- scanf("%lf", &num2);
- if (num2>num1) {
- maior=num2;
- }
- if (num2<num1) {
- menor=num2;
- }
- printf("Digite o terceiro numero:");
- scanf("%lf", &num3);
- if (num3>num2) {
- maior=num3;
- }
- if (num3<num2) {
- menor=num3;
- printf("\n%d eh o maior numero e %d eh o menor\n\n", maior, menor);
- soma=num1 + num2 + num3;
- prod=num1 * num2 * num3;
- media=(num1+num2+num3)/3;
- printf("A soma eh %d, o produto eh %d e a media eh %d\n", soma, prod, media);
- system ("pause");
- return (0);
- }
Add Comment
Please, Sign In to add comment