steemibu351 avatar

Simple c++ coding to find out monthly telephone bill using while loop id if else statement.

steemibu351

Published: 16 Dec 2021 › Updated: 16 Dec 2021Simple c++ coding to find out monthly telephone bill using while loop id if else statement.

Simple c++ coding to find out monthly telephone bill using while loop id if else statement.

images (4).jpeg

Image Source

There must be the word "iostream" in <> after include in first line.

#include
#include<conio.h>
using namespace std;
int main()
{
int si,calls;
float bill;
while(true)
{
cout<<"enter the serial number"<<endl;
cin>>si;
if(si==0)
{
break;
}
cout<<"enter the number of calls"<<endl;
cin>>calls;
if(calls<=100)
{
bill=200;
}

    else if(calls>100 && calls<=150)
    {
        calls=calls-100;
        bill=200+(calls*0.60);
    }
     else if(calls>150 && calls<=200)
    {
        calls=calls-150;
        bill=200+(50*0.60)+(calls*0.50);
    }
     else
    {
        calls=calls-200;
        bill=200+(50*0.60)+(50*0.50)+(calls*0.40);
    }
    cout<<"the total bills tk ="<<bill<<endl;
}
getch();

}

Leave Simple c++ coding to find out monthly telephone bill using while loop id if else statement. to:

Written by

Read more #coding posts


Best Posts From steemibu351

We have not curated any of steemibu351's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From steemibu351