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
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 |
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 |
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?
What is the advantage of c?
Explain the array representation of a binary tree in C.
How many main () function we can have in a project?
Write a program for finding factorial of a number.
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?
What is output of the following program ? main() { i = 1; printf("%d %d %d\n",i,i++,i++); }
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); }
Explain what is the most efficient way to store flag values?
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
What is meant by realloc()?
what is the output of below pgm? void main() { int i=0; if(i) printf("pass"); else printf("fail"); }