This program will accept qnantity of item and rate and calculate total amount and net amount.
#include<iostream.h>
#include<conio.h>
main()
{
clrscr();
int q[3],p[3],tot[3];
int net =0;
for(int i=0;i<=2;i++)
{
cout<<"ENTER QUANT. OF ITEMS :";
cin>> q[i];
cout<<"ENTER RATE IN PER KG :";
cin>> p[i];
tot[i]= q[i]*p[i];
cout<< tot[i] <<endl;
net = net + tot[i];
}
cout << "Grand total is=";
cout << net <<endl;
getch();
}
No comments:
Post a Comment