Friday 18 March 2016

Solution of URI 1113 :: Ascending and Descending


Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comment.

/**Bismillahir Rahmanir Rahim.**/

#include <stdio.h>
int main()
{
    int a,b;
    while(1)
    {
        scanf("%d%d", &a, &b);
        if(a==b)
            break;
        else
        {
            if(a<b)
                printf("Crescente\n");
            else
                printf("Decrescente\n");
        }
    }
    return 0;
}

8 comments:

  1. while(1) er kaaj ta ektu bujai bolben??? aita bujtesi na

    ReplyDelete

  2. #include
    int main()
    {
    int X,Y,i;
    for(i=1;i<=4;i++)
    {
    scanf("%d%d",&X,&Y);
    if(X==Y)
    break;
    else
    {
    if(X>Y)
    {
    printf("Decrescente\n");
    }
    else
    printf("Crescente\n");


    }


    }
    return 0;
    }
    amr soluation ta submit nicca na keno ?

    ReplyDelete
    Replies
    1. apni for loop use korsen tai???for loop hobe na

      Delete
    2. (i=1;i<=4;i++) here u can use at least i<=100 times then it will be ok

      Delete
  3. loop ta thik nai... ekhane sudhu 4 porjontoi na several tai while dhore korlei hoye jabe

    ReplyDelete
  4. we should get inputs first and then print all the out outputs.how to do it?

    ReplyDelete
  5. we should get inputs first and then print all the out outputs.how to do it?

    ReplyDelete

Note: only a member of this blog may post a comment.