Showing posts with label c programming. Show all posts
Showing posts with label c programming. Show all posts

Monday, December 17, 2012

Use of if logical operators

1st about discount using if and logical operators
#include <stdio.h>
#include <conio.h>

void main()
{
int ppi;
int ib;
int tp;
int dis;
clrscr();

printf("price per item\n");
scanf("%d",&ppi);
printf("items bought\n");
scanf("%d",&ib);


tp=ppi*ib;

printf("total price =%d\n",tp);

if(ib>1&&ib<=15){
dis=tp-(tp*5)/100;
printf("discounted Price %d",dis);