Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // receba tres valores e mostre em ordem crescente sem estrutura de repetiçao.
- #include <stdio.h>
- #include <conio.h>
- int main(){
- int a, b, c;
- printf("digite os valores: \n");
- scanf("%d %d %d", &a, &b, &c);
- if(a <= b && a <= c){
- if(b <= c)
- printf("os valores ficarao a b c %d %d %d ", a, b, c);
- else
- printf("os valores ficarao a c b %d %d %d ", a, c, b);
- }else if(b<=a && b<=c){
- if(a<=c)
- printf("os valores ficarao b a c %d %d %d ", b, a, c);
- else
- printf("os valores ficarao b c a %d %d %d ", b, c, a);
- }else{
- if(a<=b)
- printf("os valores ficarao c a b %d %d %d ", c, a, b);
- else
- printf("os valores ficarao c b a %d %d %d ", c, b, a);
- }
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement