WHILE LOOP,FILE STREAM I/O,IF..ELSE,REFERENCE PARAMETERS AND VALUE PARAMETERS (AS NEED)
Anybody can help me to create a program c++?
//print a table of N from 1 to M
#include%26lt;iostream.h%26gt;
#include%26lt;conio.h%26gt;
#include%26lt;iomanip.h%26gt;
void main()
{
int n,m,i ;
char cho ;
clrscr() ;
do{
cout%26lt;%26lt;"Enter n %26amp; m" ;
cin%26gt;%26gt;n%26gt;%26gt;m ;
cout%26lt;%26lt;"Table of "%26lt;%26lt;n ;
for(i=1;i%26lt;=m;i++)
cout%26lt;%26lt;endl%26lt;%26lt;setw(3)%26lt;%26lt;n%26lt;%26lt;" x "%26lt;%26lt;setw(3)%26lt;%26lt;i%26lt;%26lt;" = "%26lt;%26lt;setw(3)%26lt;%26lt;n*i ;
cout%26lt;%26lt;"\nContinue? Y/N" ;
cin%26gt;%26gt;cho ;
}while(cho=='Y'||cho=='y') ;
getch() ;
}
Reply:A good investment would be a 'Learn C++ in 24 hours book'
Reply:#include %26lt;iostream%26gt;
#include %26lt;fstream%26gt;
using namespace std;
void main() {
string testedperson = "helpplzhelpplz";
ofstream stupidpersonlist;
stupidpersonlist.open ("stupidolist.txt");
if (lazytest(%26amp;testedperson) == true)
result = "Smart";
else
result = "Stupid";
stupidpersonlist %26lt;%26lt; testedperson + " is a " + result + "person" ;
stupidpersonlist.close
}
bool lazytest(string * beingtested) {
string asker = *beingtested;
while (asker = "lazy") {
stupidity += 1;
grade -= 1;
if (asker != "lazy") {
cout %26lt;%26lt; "You shouldn't ask this question/n";
return 1;
}
}
return 0;
}
Reply:Arent you taking this class to learn how to do this??
Reply:??? canot understand what you want me to do. Do you have a hyperlink or something?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment