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);
#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);