Problem Description
The cost prince of n articles is the same as the selling price of X articles . If the profit is p% then what is the value of x?
Input format:
The first input is an integer which corresponds to n the second is an integer which corresponds to p
Output Formt:
Refer sample Input and output for formatting Specifications
The float values are displayed correct to 2 decimal places.Test Case 1
Input (stdin)12.5 14.5
Expected Output10.92
Test Case 2
Input (stdin)5.0 6.0
Expected Output4.72
Program
#include <stdio.h> int main() { float cp,sp,x; scanf("%f%f",&cp,&sp); x=(cp*100)/(sp+100); printf("%.2f",x); return 0; }
No comments:
Post a Comment
Note: only a member of this blog may post a comment.