[ create a new paste ] login | about

Link: http://codepad.org/f9mGJxWJ    [ raw code | output | fork ]

C, pasted on Aug 15:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdio.h>
	main (void)
{
	int dis,q;
	float p, tot;
	printf ("enter the quantity(Q) and price (P)\n");
	scanf ("%d%f",&q,&p);
	if (q>1000)
	{
		dis = 10;
		tot = (p*q)-(p*q*10/100);
	}
	else
	tot = p*q;
	printf ("total expenses = Rs %c\n");
	return 0;
}


Output:
1
2
enter the quantity(Q) and price (P)
total expenses = Rs �


Create a new paste based on this one


Comments: