Saturday, 5 March 2022

10. Write a program to calculate bill of a job work done as follows. Use if else statement. a) Rate of typing 3 Rs/page b) Printing of 1st copy 5Rs/pages & later every copy 3Rs/page. The user should enter the number of pages and print out copies he/she wants.



#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

python programs

1. sum of two number