Pages

Friday, March 21, 2025

code to calculate bill of things (gst 18% included)

#include<iostream>
using namespace std;

//code to calculate bill of 3 things
int main() {
    float pencil;
    float pen;
    float eraser;

    cout<<"enter pencil price: ";
    cin>>pencil;

    cout<<"enter pen price: ";
    cin>>pen;

    cout<<"enter eraser price: ";
    cin>>eraser;

    float bill = pencil+pen+eraser;
    float gst = bill*0.18;  // gst calculation
    float gstbill = bill+gst; // final bill after gst

    cout<<"total bill (before gst)= "<<bill<<endl;
    cout<<"total bill (after gst)= "<<gstbill<<endl;

    return 0;
}

No comments:

Post a Comment

Multi-dimensional ArrayList in Java

  // import java.util.ArrayList; import java.util. * ; // import java.util.Collections; public class Classroom {     public static voi...