Write the programs for the following.
-----------------------------------------------------------------------------------------------------------------------------------
1. Accept numbers from the keyboard till the user presses 'N' or 'n'.
From these accepted numbers display the sum of minimum and maximum.
2. Accept two alphabetic characters, and write a program to display
all alphabets lying within the range.
e.g. if characters entered are 'd' and 'j',
your program must display e, f, g, h, i
3. Write a program to display a multiplication table of a given number
with in a given range.
The program should accept the range, and the number.
e.g. if the range given is from 2 to 6 and the number is 4,
then display the table as;
4 x 2 = 8
4 x 3 = 12
4 x 4 = 16
4 x 5 = 20
4 x 6 = 24
4. Write a program to display the first N multiples of an integer Num.
Both N and Num must be accepted from the keyboard.
e.g. if N=3 and Num=5,
then display 3, 6, 9, 12, 15
5. Enter a number (for the number of output lines or rows to display),
and print as follows.
e.g. If Number entered is 4, then display
1
2 3
3 4 5
4 5 6 7
6. From a set of N positive numbers, find out the lowest number entered.
Note that if a negative number is entered, it should be considered
as an invalid entry, and should be rejected by the program.
7. Accept 10 positive even numbers using a loop and display their average.
-----------------------------------------------------------------------------------------------------------------------------------
1. Accept numbers from the keyboard till the user presses 'N' or 'n'.
From these accepted numbers display the sum of minimum and maximum.
2. Accept two alphabetic characters, and write a program to display
all alphabets lying within the range.
e.g. if characters entered are 'd' and 'j',
your program must display e, f, g, h, i
3. Write a program to display a multiplication table of a given number
with in a given range.
The program should accept the range, and the number.
e.g. if the range given is from 2 to 6 and the number is 4,
then display the table as;
4 x 2 = 8
4 x 3 = 12
4 x 4 = 16
4 x 5 = 20
4 x 6 = 24
4. Write a program to display the first N multiples of an integer Num.
Both N and Num must be accepted from the keyboard.
e.g. if N=3 and Num=5,
then display 3, 6, 9, 12, 15
5. Enter a number (for the number of output lines or rows to display),
and print as follows.
e.g. If Number entered is 4, then display
1
2 3
3 4 5
4 5 6 7
6. From a set of N positive numbers, find out the lowest number entered.
Note that if a negative number is entered, it should be considered
as an invalid entry, and should be rejected by the program.
7. Accept 10 positive even numbers using a loop and display their average.
0 comments:
Post a Comment