Friday, October 26, 2018

Uri 1116 solution in C | Dividing X by Y

/*Before seeing the code solution make sure that you have tried enough. Don’t copy- paste the whole code. Find out the logic. If you face any trouble, just inform me in comment.*/


#include<stdio.h>
main()
{
    int x,y,n,i;
    double t;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
        scanf("%d%d",&x,&y);
        if(y==0)
        {
            printf("divisao impossivel\n");
        }
        else
        {
                   t=x/(y*1.00);
            printf("%.1lf\n",t);
        }

    }
    return 0;

}

 //Happy_Coding

1 comment: