Saturday, March 18, 2017

URI problem 1118 solution in C | (Several Scores with Validation)

To get the solution, click the link below:


link:
https://codespathshala.com/uri-1118/


/

1 comment:

  1. hello sir can you please tell me why it is not correct???
    #include
    main()
    {
    int X;
    double a,b,s=0,av;
    while(1)
    {
    scanf("%lf%lf",&a,&b);
    if(a>=0&&b>=0&&a<=10&&b<=10)
    {
    s=a+b;
    av=s/2.0;
    printf("media = %.2lf\n",av);
    printf("novo calculo (1-sim 2-nao)\n");
    scanf("%d",&X);
    if(X==2)
    break;
    else
    continue;

    }
    else
    printf("nota invalida\n");
    }
    return 0;
    }

    ReplyDelete