Simple C++ Program for billing

Updated rajesanthu -4 Tallied Votes 10K Views Share

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

Jercil commented: Output please +0
#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();
}
Nick Evan 4,005 Industrious Poster Team Colleague Featured Poster

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.

commented: Yes! +5
commented: all true +0
Monu_1 0 Newbie Poster

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.