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


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

Re: Request for help

From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c++
Subject Re: Request for help
Date 2011-10-18 20:00 +1300
Message-ID <9g4mh2FkohU1@mid.individual.net> (permalink)
References <200f3cee-b57e-4fe6-a70c-8f27029deb34@13g2000prp.googlegroups.com>

Show all headers | View raw


On 10/18/11 06:55 PM, gpy5504@hotmail.com wrote:
> 1. Write a program which prompts the user to enter an integer between
> 1 and 9.
> Based on the inputted number, the program outputs a triangular textual
> shape using digits
> (see below).
> Sample Execution:
> Enter N: 5
> 12345
> 1234
> 123
> 12
> 1
>
> 2.1. The Fibonacci sequence is a sequence of numbers beginning
> 1, 1, 2, 3, 5, 8, 13, 21, ...
> The first two elements are defined to be 1. Each of the other elements
> is the sum of its
> two predecessors. Write a program that takes a value for N in the
> range 1 to 30 and
> displays the first N elements of the Fibonacci sequence.
> Sample Execution:
> Enter N: 9
> Fibonacci sequence: 1 1 2 3 5 8 13 21 34
>
> 2. An integer P is called a prime number if the only positive integers
> that divide P are
> 1 and P itself. Write a program which inputs a number N between 2 and
> 100 and then
> loops through integers 2 to N and displays only those numbers which
> are prime.
> Sample Execution:
> Enter N: 15
> 2 3 5 7 11 13

Where's you code?

-- 
Ian Collins

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


Thread

Request for help gpy5504@hotmail.com - 2011-10-17 22:55 -0700
  Re: Request for help Ian Collins <ian-news@hotmail.com> - 2011-10-18 20:00 +1300
    Re: Request for help gpy5504@hotmail.com - 2011-10-18 00:30 -0700
      Re: Request for help Juha Nieminen <nospam@thanks.invalid> - 2011-10-18 08:22 +0000
      Re: Request for help Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-10-18 03:41 -0700
  Re: Request for help Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-10-18 02:51 -0700
    Re: Request for help Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-10-23 06:21 -0700
  Re: Request for help red floyd <no.spam.here@its.invalid> - 2011-10-18 12:54 -0700

csiph-web