Repetition 16 Questions and Answerss Pi
Repetition 16 Questions and Answerss Pi
h>
int main(void){
int type,quantity;
float discount,price,total=0;
scanf("%d",&type);
while(type!=-1){
total=0;
printf("Enter Quantity:");
scanf("%d",&quantity);
if(type==1){
price=1000.00;
discount=10;
else if(type==2){
price=1600.00;
discount=12;
else if(type==3){
price=1400.00;
discount=15;
if(quantity>3){
total=quantity*price;
total=total-(total*(discount/100));
else{
total=quantity*price;
return 0;
#include<stdio.h>
int main(void){
int item,quantity;
float total=0,price;
printf("Enter item:");
scanf("%d",&item);
while(item!=-99){
printf("Enter Quantity:");
scanf("%d",&quantity);
if(item==1){
price=30.00;}
else if(item==2)
price=45.00;
else if(item==3){
price=55.50;}
else{
total=total+(price*quantity);
printf("\n");
printf("Enter item:");
scanf("%d",&item);
return 0;}
#include<stdio.h>
int main(void){
int item,quantity;
float Uprice,total=0;
printf("\nEnter Item:");
scanf("%d",&item);
while(item!=-1){
printf("Enter Quantity:");
scanf("%d",&quantity);
if(item==1)
Uprice=300.25;
else if(item==2)
Uprice=145.50;
else if(item==3)
Uprice=525.00;
else{
total=total+(quantity*Uprice);
printf("\nEnter Item:");
scanf("%d",&item);}
return 0;
}
#include<stdio.h>
int main(void){
int Btype,quantity;
float Total,Extra;
printf("Enter The Buger type:");
scanf("%d",&Btype);
Total=0;
printf("Enter Quantity:");
scanf("%d",&quantity);
if(Btype==1)
Extra=0;
else if(Btype==2)
Extra=50.00;
else if(Btype==3)
Extra=100.00;
Total=(500.00+Extra)*quantity;
scanf("%d",&Btype);
return 0;
}
#include<stdio.h>
int main(void){
int players,round,count,score,total=0;
scanf("%d",&players);
for(count=1;count<=players;count++){
total=0;
for(round=1;round<=4;round++){
printf("round %d-",round);
scanf("%d",&score);
total=total+score;
else{
round--;
printf("average score-%.1f\n",total/4.0);}
return 0;
}
#include<stdio.h>
int main(void){
int students,Mcount,count,marks,total;
scanf("%d",&students);
for(count=1;count<=students;count++){
total=0;
for(Mcount=1;Mcount<=3;Mcount++){
printf("mark %d-",Mcount);
scanf("%d",&marks);
total=total+marks;
else{
Mcount--;
printf("Total marks-%d\n",total);
}
#include<stdio.h>
int main(void){
char player;
int Pcount=0,round,score,total;
do{
Pcount++;
total=0;
for(round=1;round<=3;round++){
printf("round %d-",round);
scanf("%d",&score);
total=total+score;
else{
round--;
printf("average score-%.2f\n",total/3.0);
scanf(" %c",&player);
}while(player=='y' || player=='Y');
return 0;
}
#include<stdio.h>
int main(void){
int players,round,count,score,total;
for(count=1;count<=players;count++){
total=0;
for(round=1;round<=2;round++){
printf("round %d-",round);
scanf("%d",&score);
total=total+score;
else{
round--;
printf("average score-%.1f\n",total/2.0);
}
#include<stdio.h>
int main(void)
int Mcount,Scount=0,marks,total;
char student;
do{
Scount++;
total=0;
for(Mcount=1;Mcount<=3;Mcount++){
printf("Mark %d-",Mcount);
scanf("%d",&marks);
else{
Mcount--;
printf("\ntotal=%d",total);
scanf(" %c",&student);
}while(student=='y' || student=='Y');
return 0;
}
#include<stdio.h>
int main(void)
int Mcount,Scount=0,marks,total;
char student;
do{
Scount++;
total=0;
for(Mcount=1;Mcount<=4;Mcount++){
printf("Mark %d-",Mcount);
scanf("%d",&marks);
total+=marks;
else{
Mcount--;
printf("\ntotal=%d",total);
scanf(" %c",&student);
}while(student=='y' || student=='Y');
return 0;
}
#include<stdio.h>
int main(void){
int number,range,count;
scanf("%d",&number);
scanf("%d",&range);
for(count=1;count<=range;count++){
printf("%d x %d=%d\n",number,count,number*count);
return 0;
}
#include<stdio.h>
int main(void){
int players,score,total=0,count,Pnumber,win,max=0;
scanf("%d",&players);
for(players;0<players;players--){
total=0;
for(count=1;count<=3;count++){
scanf("%d",&score);
total=total+score;
printf("Total Score:%d",total);
if(total>=max){
max=total;
win=Pnumber;
return 0;
}
#include<stdio.h>
int main(void){
int count,marks,total=0;
float average;
for(count=1;count<=5;count++){
scanf("%d",&marks);
if(marks>=0 && marks<=100)
total=total+marks;
else{
printf("Invalid Input!!\n");
count--;
return 0;
}
#include<stdio.h>
int main(void){
char player;
int Pcount=0,round,score,total;
do{
Pcount++;
total=0;
for(round=1;round<=5;round++){
printf("round %d-",round);
scanf("%d",&score);
else{
round--;
printf("average score-%.2f\n",total/5.0);
scanf(" %c",&player);
}while(player=='y' || player=='Y');
return 0;
}
#include<stdio.h>
int main(void){
char player;
int Pcount=0,round,score,total;
do{
Pcount++;
total=0;
for(round=1;round<=3;round++){
printf("round %d-",round);
scanf("%d",&score);
if(0<=score && 5>score)
total=total+score;
else{
round--;
printf("average score-%.2f\n",total/3.0);
scanf(" %c",&player);
}while(player=='y' || player=='Y');
return 0;
}
#include<stdio.h>
int main(void){
int number,count;
do{
printf("Enter Number:");
scanf("%d",&number);
if(number>0)
break;
printf("Invalid Number\n");
}while(1);
for(count=1;count<=10;count++){
printf("%d x %d=%d\n",number,count,number*count);