Computer Science, asked by kalpanaakanna, 1 year ago

How to write a program in c to find the cost of 17 pencils if the cost of one pencil is 2 rupees 50 paise

Answers

Answered by sid590
0

int main()

{

int p;

float c;

printf("cost of the each pencil=");

scanf("%f", &c);

print("no of pencil=");

scanf("%d", &p);

float cost=p*c;

printf("required cost of pencils is =%d rupees and %d paise \n", cost/1, cost*100/100);

return 0;

}

// hope this helps you out

Similar questions