0% found this document useful (0 votes)
12 views15 pages

Programs 2023

The document outlines 14 programming questions and programs that involve tasks such as inputting and displaying messages, comparing and identifying the largest/smallest numbers from user inputs, calculating student grades based on subject scores, generating patterns using loops, computing series, checking for palindromes, identifying prime/composite numbers, displaying Fibonacci sequences, finding greatest common divisors and least common multiples, counting characters in strings, checking for palindromes in strings and converting case, validating phone numbers, and counting words and vowels in strings.

Uploaded by

bomebi4596
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views15 pages

Programs 2023

The document outlines 14 programming questions and programs that involve tasks such as inputting and displaying messages, comparing and identifying the largest/smallest numbers from user inputs, calculating student grades based on subject scores, generating patterns using loops, computing series, checking for palindromes, identifying prime/composite numbers, displaying Fibonacci sequences, finding greatest common divisors and least common multiples, counting characters in strings, checking for palindromes in strings and converting case, validating phone numbers, and counting words and vowels in strings.

Uploaded by

bomebi4596
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Program 1

Q1. Input a welcome message and display it.

Program:

Output:
Program 2
Q2. Input two numbers and display the larger / smaller number.

Program:

Output:
Program 3

Q3. Input three numbers and display the largest / smallest number.

Program:

Output:
Program 4

Q4. Calculate the student's grade based on the results of


five subjects.
Based on the marks obtained in N number of subjects
The grade must be calculated as per the following rules:

Average Mark Grade


91-100 A1
81-90 A2
71-80 B1
61-70 B2
51-60 C1
41-50 C2
33-40 D
21-32 E1
0-20 E2

Program:
Output:
Program 5
Q6. Generate the patterns using nested loop.

* *

* * *

* * * *

* * * * *

Program:

Output:
Program 6
Q6. Generate the series.
𝟏 𝟏 𝟏 𝟏
𝒔𝒆𝒓𝒊𝒆𝒔 = 𝟏 + + 𝟐 + 𝟑 +⋯+ 𝒑
𝒏 𝒏 𝒏 𝒏

Program:

Output:
Program 7

Q7: Determine whether a number is palindrome

Program:

Output:
Program 8

Q8. Input a number and check if the number is a prime or


composite number.

Program:

Output:
Program 9

Q9. Display the terms of a Fibonacci series.

Program:

Output:
Program 10

Q10. Compute the greatest common divisor and least common


multiple of two integers.

Program:

Output:
Program 11
Q11. Count and display the number of vowels, consonants,
uppercase, lowercase characters in string.

Program:

Output:
Program 12
Q12. Input a string and determine whether it is a palindrome or
not; convert the case of characters in a string.
Program:

Output:
Program 13
Q13. Write a program that prompts for a phone number of 10 digits
and two dashes, with dashes after the area code and the next three
numbers. For example, 017-555-1212 is a legal input. Display if the
phone number entered is valid format or not and display if the
phone number is valid or not (i.e., contains just the digits and dash
at specific places.)
Program:

Output:
Program 14
Q14. Write a Python program to count the number of words in a
string. Also count the number of words that starts with vowels.

Program:

Output:

You might also like