Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(int argc, char *argv[])
- {
- int A,B,C,D,AUX;
- printf("Insira os valores de A,B,C e D respectivamente:\n\n");
- printf("A=");
- scanf("%d",&A);
- printf("B=");
- scanf("%d",&B);
- printf("C=");
- scanf("%d",&C);
- printf("D=");
- scanf("%d",&D);
- printf("\n");
- if(A>B){
- AUX=A;
- A=B;
- B=AUX;
- }
- if(A>C){
- AUX=A;
- A=C;
- C=AUX;
- }
- if(A>D){
- AUX=A;
- A=D;
- D=AUX;
- }
- if(B>C){
- AUX=B;
- B=C;
- C=AUX;
- }
- if(B>D){
- AUX=B;
- B=D;
- D=AUX;
- }
- if(C>D){
- AUX=C;
- C=D;
- D=AUX;
- }
- printf("A ordem crescente destes numeros e:\n\n");
- printf("1o=%d \n",A);
- printf("2o=%d \n",B);
- printf("3o=%d \n",C);
- printf("4o=%d \n",D);
- getch();
- return 0;
- }
Add Comment
Please, Sign In to add comment