google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 Write a program to calculate discount - 2nd puc computer science

Write a program to calculate discount

 /*Write a C++ program to input the total amount in a bill, if the amount is greater than 1000, a discount of 8% is given. Otherwise, no discount is given. Output the total amount, discount and the final amount.*/

#include<iostream.h>

#include<conio.h>

void main( )

{

float amount, discount=0.0, netdiscount,netamount ;

clrscr( );

cout<<"Enter amount"<<endl;

cin>>amount;

if(amount>=1000.0)

discount = 8.0/100.0;

netdiscount=amount*discount;

netamount=amount-netdiscount;

cout<<"Net discount="<<netdiscount<<endl;

cout<<"Net amount="<<netamount<<endl;

getch( );

}

Write a program to calculate discount Write a program to calculate discount Reviewed by Vision Academy on February 27, 2022 Rating: 5

No comments:

CheckOut

Powered by Blogger.