English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Write a program to read a positive integer at least equal to 3, and print out all possible permutations of three positive integers less or equal to than this value?

2007-06-11 22:53:43 · 1 answers · asked by gowth29 1 in Computers & Internet Programming & Design

1 answers

It sounds like you are to write a program which you will enter a 1, 2 or 3. The program will not accept any other numbers.

After entering a number there will alway be three integers printed (digits) these digits will be made up of numbers limited by what you entered above . press a 1 you only can use the number 1,.
press a 2 you can only use the numbers 1 & 2 .
press three you can only use the numbers 1,2& 3

permutation means show the unique combinations. Think how many unique combinations of integers there are when you count from 100 to 999. THese use combinations of the integers 0 to 9

You will most likely use three nested For/Next loops and you will limit these for loop to generate numbers starting at 1 to what ever number you typed in.

Think how an odometer in a car works to display miles

2007-06-12 00:22:21 · answer #1 · answered by MarkG 7 · 0 0

fedest.com, questions and answers