if the total selling price of 15 items and the total profit
earned on them is input through the keyboard, write a program
to find the cost price of one of the item

Answers were Sorted based on User's Feedback



if the total selling price of 15 items and the total profit earned on them is input through the ke..

Answer / jiaul haque sabuj

main()
{
float X,Y,Z,A;
printf("Please Enter the Total Price Of 15 Items : ");
scanf("%f",&X);
printf("Please Enter the total profit Earned on them : ");
scanf("%f",&Y);
Z=(X-Y)/15;
printf("The Cost Price of One Item is : %.2f",Z);
}

Is This Answer Correct ?    5 Yes 1 No

if the total selling price of 15 items and the total profit earned on them is input through the ke..

Answer / gagan kumar

void main()
{
int sell_pr, profit, cost_pr, cost_pr_one_item ;
clrscr();
printf(“Please enter the selling price of 15 items:”);
scanf(“%d”, &sell_pr);
printf(“Please enter the profit earned on 15 items:”);
scanf(“%d”, &profit);
cost_pr = sell_pr – profit;
cost_pr_one_item = cost_pr/15;
printf(“Cost price of one item is %d”, cost_pr_one_item);
getch();
}

Is This Answer Correct ?    6 Yes 5 No

Post New Answer

More C Interview Questions

Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it?

3 Answers  


What is the advantage of c?

0 Answers  


Explain the array representation of a binary tree in C.

0 Answers   Genpact,


How many main () function we can have in a project?

0 Answers  


Write a program for finding factorial of a number.

0 Answers   Tech Mahindra,






52.write a “Hello World” program in “c” without using a semicolon? 53.Give a method to count the number of ones in a 32 bit number? 54.write a program that print itself even if the source file is deleted? 55.Given an unsigned integer, find if the number is power of 2?

9 Answers  


What is output of the following program ? main() { i = 1; printf("%d %d %d\n",i,i++,i++); }

9 Answers   CTS, Wipro,


Explain this code. #include <stdio.h> void f1(int *k) { *k = *k + 10; } main ( ){ int i; i = 0; printf (" The value of i before call %d \n", i); f1 (&i); printf (" The value of i after call %d \n", i); }

3 Answers   IBM,


Explain what is the most efficient way to store flag values?

0 Answers  


what does the following code do? fn(int n,int p,int r) { static int a=p; switch(n){ case 4:a+=a*r; case 3:a+=a*r; case 2:a+=a*r; case 1:a+=a*r; } } a.computes simple interest for one year b.computes amount on compound interest for 1 to 4 years c.computes simple interest for four year d.computes compound interst for 1 year

7 Answers   TCS,


What is meant by realloc()?

0 Answers  


what is the output of below pgm? void main() { int i=0; if(i) printf("pass"); else printf("fail"); }

4 Answers  


Categories