Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void ordenar(int *a, int *b, int *c){
- if(*a > *c){
- int aux = *c;
- *c = *a;
- *a = aux;
- }
- if(*a > *b){
- int aux = *b;
- *b = *a;
- *a = aux;
- }
- if(*b > *c){
- int aux = *c;
- *c = *b;
- *b = aux;
- }
- }
- int main()
- {
- int a, b, c;
- printf("Digite o valor dos numeros:");
- scanf("%d %d %d", &a, &b, &c);
- printf("Numeros digitados: %d %d %d", a, b, c);
- ordenar(&a, &b, &c);
- printf("\n\n");
- printf("Numeros em ordem crescnte: %d %d %d", a, b, c);
- return 0;
- }
Add Comment
Please, Sign In to add comment