Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #7358

Re: please help me to get the coding please

From gottloser Vaterlandsverraeter <vaterlandsverraeter@gmail.com>
Newsgroups comp.lang.c++
Subject Re: please help me to get the coding please
Date 2011-07-02 09:48 +0200
Organization Aioe.org NNTP Server
Message-ID <iumigg$5lr$1@speranza.aioe.org> (permalink)
References <404c4efc-13ee-4159-9854-ba3054722823@p10g2000prf.googlegroups.com>

Show all headers | View raw


Am 02.07.2011 04:01, schrieb JetQi Tan:
>  Modify the program to ask two integer numbers from the user and then
> output all the integer numbers in
> between these two numbers. Assume that the user will enter the first
> number to be smaller than the
> second number


///////////////////////////////////////////////////////////////////////
/* to compile run:
 *
 * g++ -o numbers numbers.cpp
 *
*/

// include the iostream functionality from iostream.h
#include <iostream>

using namespace std;

// main function
main(){
	cout<< "Enter first number"<< endl;
	int first, second;
	cin>> first;
	cout<< "Enter second number"<< endl;
	cin>> second;
	for(int counter = first;
			counter <= second;
			counter++){
		cout<< counter<< ", ";
	}
	cout<< endl;
}
/////////////////////////////////////////////////////////////

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

please help me to get the coding please JetQi Tan <jetqi1011@gmail.com> - 2011-07-01 19:01 -0700
  Re: please help me to get the coding please Saeed Amrollahi <amrollahi.saeed@gmail.com> - 2011-07-01 22:36 -0700
    Re: please help me to get the coding please JetQi Tan <jetqi1011@gmail.com> - 2011-07-02 00:29 -0700
      Re: please help me to get the coding please Ian Collins <ian-news@hotmail.com> - 2011-07-02 19:32 +1200
        Re: please help me to get the coding please JetQi Tan <jetqi1011@gmail.com> - 2011-07-02 00:37 -0700
          Re: please help me to get the coding please Saeed Amrollahi <amrollahi.saeed@gmail.com> - 2011-07-02 00:49 -0700
          Re: please help me to get the coding please Ian Collins <ian-news@hotmail.com> - 2011-07-02 19:51 +1200
            Re: please help me to get the coding please JetQi Tan <jetqi1011@gmail.com> - 2011-07-02 01:02 -0700
  Re: please help me to get the coding please Juha Nieminen <nospam@thanks.invalid> - 2011-07-02 06:02 +0000
    Re: please help me to get the coding please JetQi Tan <jetqi1011@gmail.com> - 2011-07-02 00:32 -0700
      Re: please help me to get the coding please Juha Nieminen <nospam@thanks.invalid> - 2011-07-02 08:15 +0000
  Re: please help me to get the coding please gottloser Vaterlandsverraeter <vaterlandsverraeter@gmail.com> - 2011-07-02 09:48 +0200
  Re: please help me to get the coding please Ruben Safir <ruben@mrbrklyn.com> - 2011-07-03 03:24 +0000
  Re: please help me to get the coding please "MikeP" <mp011011@some.org> - 2011-07-07 16:38 -0500

csiph-web