Article View: att.lang.c++
Article #109New CSCI Student needing help!!
From: CM
Date: Sun, 29 Sep 2002 17:03
Date: Sun, 29 Sep 2002 17:03
34 lines
2427 bytes
2427 bytes
Hello all,
I have what I am sure most of you will find an extremely easy program to
write. It is to simply multiply two numbers together without using '*' So,
two numbers, X times Y - X+X+X .. Y times. I imagine a for loop is needed
but I can not figure out how to write it and - also have searched for a few
hours for clues on how to. Below is what I have so far, don't laugh, I have
to start somewhere!! But nonetheless, I have to get rid of the expression
c=a*b and get a loop in there ... Can anyone help me?
#include <iostream>
using namespace std;
int main()
{
double a;
double c;
double b;
cout << "This program will multiply two integers:" <<endl;
cout << "Please enter first number:" <<endl;
cin >> a;
cout << "Please enter second number:"<<endl;
cin >> b;
c=a*b;
cout <<"The answer is " << c <<endl;
}
--
CM
Technical Details
Message-ID:
<EnGl9.19402$q42.1001817@bin3.nnrp.aus1.giganews.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed-east.nntpserver.com!nntpserver.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin3.nnrp.aus1.giganews.com.POSTED!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4ba,d133c4fb76037b3e,start X-Google-Attributes: gid10d4ba,public X-Google-Thread: 109fba,d133c4fb76037b3e,start X-Google-Attributes: gid109fba,public X-Google-ArrivalTime: 2002-09-29 10:03:32 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed-east.nntpserver.com!nntpserver.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin3.nnrp.aus1.giganews.com.POSTED!not-for-mail From: "CM" <mckenzie992@comcast.net> Newsgroups: att.lang.c++,comp.lang.c++ Subject: New CSCI Student needing help!! X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-GC-Trace: gv1-gZeKUvHN0AWUCNQwxrYYlsBrYuasjAGzupB Message-ID: <EnGl9.19402$q42.1001817@bin3.nnrp.aus1.giganews.com> NNTP-Posting-Date: Sun, 29 Sep 2002 12:03:32 CDT Organization: Giganews.Com - Premium News Outsourcing Lines: 36 X-Trace: sv3-KAy2vv/leQTjLfXyl4EKUxfpvMXYWQRWj7Pb/ILk7xX8MEmsAM/JyQavaTw6GudmtkIplvUX74vmv7n!h7On+v7ekpQT/PO9I6p6UNW0BTM9OlMOcE1o1L4Za4fPMxpqyViIY234wdPn8zQ3Npa3uZcbfHCI!Hiu6gN8FHuzdIWD5dIv3Ohvrd5zmYw== X-Complaints-To: abuse@comcast.com X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sun, 29 Sep 2002 17:03:32 GMT