TAB

One of the works done by our Robotics and Machine Learning division,
SELF-LEVELING QUADCOPTER
Arduino based Quadcopter.
Self-leveling is acheived by the aligning the quadcopter using the readings from the gryo as well as the accelerometer.
A four channel RC transmitter is used to control the movement of the quadcopter when in flight. Kindly subscribe to our YouTube Channel and stay tuned.

Friday 22 January 2016

Practice Problem 1 (20-1 to 27-1) : WAGE

#include <stdio.h>
#include<math.h>
void main()
{
    int I,R,N;
    scanf("%d %d %d",&I,&R,&N);
    float G=0.0;
    if(N>40)
    {
        G=40*R+(N-40)*R*1.5;
    }
    else
    {
        G=R*N;
    }
    G=G-G*0.03625;
    G=roundf(G*100)/100;
    printf("%.2f",G);
 
}

4 comments:

  1. the expected output is 1927.500 and my output is 1927.50 what should i do ?? plaese solve this

    ReplyDelete
  2. Change printf("%.2f",G) to printf("%.3f",G)

    ReplyDelete