-5

Simple C++ program for billing
NB:Excuse me experts,,,,,This is only for beginners


1.copy and paste the program in a notepad
2.save the textfile with .cpp extension
3.select file type all
4.cut the textfile and paste it in your bin folder where turbo c is located
5.open turbo c and open the document we just saved in bin
6.if opened,press F9 to compile and then ctrl+F9 to run...
7.search the bin folder for the .exe format file with the name you given for the text
file......use it further........
try it!!!!!!!!!!!!!!!
Its your friend....
Rajeesh.N.Santhu

Edited by Nick Evan: Removed obnoxious color-tags

#include<iostream.h>
#include<conio.h>
float no,price[50],total[50],qty[50],tt;
char item[30];
void main()
{
int i,j;
clrscr();
cout<<"\n\n\t\t\tRaje's Billing Software\n\n";
cout<<"\nEnter The Number of Products you'v Purchased:";
cin>>no;
cout<<"\n\nSL No\tITEM NAME\tQUANTITY\tPRICE/ITEM\n\n";
for(i=1;i<=no;i++)
{
cout<<i;
cout<<"\t";
cin>>item;
cout<<"\t";
cin>>qty[i];
cout<<"\t";
cin>>price[i];
total[i]=price[i]*qty[i];
cout<<"\n\n";
}
for(i=1;i<=no;i++)
{
tt=tt+total[i];
}

cout<<"\n\n\t\t\tTOTAL:"<<tt<<" Rupees";
cout<<"\n\n\t\t\tTHANK YOU VISIT AGAIN.....";
getch();
}
3
Contributors
2
Replies
75
Views
6 Years
Discussion Span
Last Post by Monu_1
6

I'm sorry to tell you, but this code is just horrible; people should never ever use this snippet.

1. void main() does not exist in standard C++
2. neither does iostream.h or conio.h. They are only used by Turbo C which is only used by people from India and the Philippines for some reason. The rest of the world uses IDE's from this millennium.
3. Global variables. Yuck.
4. No indention. Double yuck.
5. neither getch() or clrsrc() are valid C++ functions
6. No error control on input what-so-ever.

Edited by Nick Evan: n/a

Votes + Comments
all true
Yes!
0

could u plz explain it in brief i am a student and doing prepairation for btech enterance

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.