Coding | Mcqs | Multiple choice questions | Informative | Computer Science | Engineering | Aptitude | Quants | Verbal

INFEED

Table Marked Price C - Relational, Logical Operators and If Else - PART001

Table Marked Price    ID:6582 

A table is sold at Rs. X after allowing a discount of Y%. The program must print the Marked Price (original price before discount) as the output.

Formula: X = Marked Price * ( 1 - Y/100)

Example Input/Output 1:

Input:

5225 5

Output:

5500

Example Input/Output 2:

Input:

250 0

Output:

250


PROGRAM IN C:


 #include <stdio.h>

int main() {

   float p;

   float dp;

   float da;

   float ddp;

    scanf("%f", &p);

    scanf("%f", &dp);

    da = (1-(dp/100));

    ddp = (p/da);

    printf("%d", ddp);

}

Post a Comment

Previous Post Next Post