You are on page 1of 4

#include <stdio.

h> int main() { int choice,person; float fee; do{ printf("\nSelect Conference:"); printf("\n1 - ICIMU2008"); printf("\n2 - ICITA2008"); printf("\n3 - SNDP2008"); printf("\n4 - MUSIC2008"); printf("\n5 - Exit"); printf("\nPlease enter your choice:"); scanf("%d",&choice); if(choice==1) { printf("How many persons would like to register?"); scanf("%d",&person); if(person>=5) fee=((person(person%5))*700*0.9)+(person%5)*700; else fee=person*700; printf("\nThe conference fee is %.2f",fee); } else if(choice==2) { printf("How many persons would like to register?"); scanf("%d",&person); if(person>=10) fee=((person(person%10))*800*0.85)+(person%10)*800; else fee=person*800; printf("\nThe conference fee is %.2f",fee); } else if(choice==3) { printf("How many persons would like to register?"); scanf("%d",&person); if(person>=2) fee=((person(person%2))*750*0.95)+(person%2)*750; else fee=person*750; printf("\nThe conference fee is %.2f",fee); } else if(choice==4) { printf("How many persons would like to register?"); scanf("%d",&person); if(person>=10) fee=((person(person%10))*200*0.9)+(person%10)*200; else

fee=person*200; printf("\nThe conference fee is %.2f",fee); } else if(choice==5) printf("\nThank you."); else printf("\nInvalid choice. Please try again."); }while(choice!=5); return 0; }

#include<stdio.h> int main() { int choice,item; float price; do { printf("\nSelect Your Choice:"); printf("\n1:Optical mouse"); printf("\n2:Pen drive 16GB"); printf("\n3:Portal hard drive 500GB"); printf("\n4:Portal hard drive 500GB + Pen drive 16GB"); printf("\n5:Exit"); printf("\nYour choice:"); scanf("%d",&choice); if(choice==1) { printf("\nHow many items would you like to purchase?:"); scanf("%d",&item); if(item>=8) price=(item-(item%8))*5*0.9+(item%8)*5; else price=item*5; printf("\nThe total price is %.2f",price); } else if(choice==2) {

printf("\nHow many items would you like to purchase?:"); scanf("%d",&item); if(item>=2) price=(item-(item%2))*60*0.95+(item%2)*60; else price=item*60; printf("\nThe total price is %.2f",price); } else if(choice==3) { printf("\nHow many items would you like to purchase?:"); scanf("%d",&item); if(item>=3) price=(item-(item%3))*250*0.9+(item%3)*250; else price=item*250; printf("\nThe total price is %.2f",price); } else if(choice==4) { printf("\nHow many items would you like to purchase?:"); scanf("%d",&item); if(item>=2) price=(item-(item%2))*300*0.98+(item%2)*300; else price=item*300; printf("\nThe total price is %.2f",price); } else if(choice==5) printf("\nThank you.\n"); else if((choice<1)||(choice>5)) printf("\nInvalid choice. Please try again");

}while(choice!=5); return 0; }

You might also like