#include<stdio.h>
#include<conio.h>
void main()
{
int page,type;
clrscr();
printf("\nA. rate of typing 3rs/page");
printf("\nB. printing of 1st copy 5rs/page & later every copy 3rs/page");
printf("\n\nenter the number of typing pages: ");
scanf("%d",&type);
printf("\nenter the number of copies: ");
scanf("%d",&page);
if(type>=1)
{
type = type * 3;
}
else
{
printf("\nenter valid number");
}
if(page>=1)
{
page = page - 1;
page = (page*3)+5;
}
else
{
printf("enter valid number");
}
printf("\n\ntyping charges: %d",type);
printf("\nprinting chargis: %d",page);
printf("\n================================");
printf("\ntotal charges: %d",type + page);
printf("\n================================");
getch();
}
/* output:
A. rate of typing 3rs/page
B. printing of 1st copy 5rs/page & later every copy 3rs/page
enter the number of typing pages: 23
enter the number of copies: 34
typing charges: 69
printing chargis: 104
================================
total charges: 173
================================
*/
No comments:
Post a Comment