0% found this document useful (0 votes)
8 views13 pages

Questions

The document contains a series of programming tasks that cover basic concepts such as calculating the area of a rectangle, swapping numbers, checking odd/even status, finding the largest of three integers, and testing divisibility. It also includes tasks related to menu display for circle calculations, character classification, quadratic equation roots, summing natural numbers, calculating factorials, and demonstrating loop control statements. Additionally, it addresses searching for prime numbers, managing lists and tuples, and creating/updating dictionaries with student information.

Uploaded by

zaidumer238
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)
8 views13 pages

Questions

The document contains a series of programming tasks that cover basic concepts such as calculating the area of a rectangle, swapping numbers, checking odd/even status, finding the largest of three integers, and testing divisibility. It also includes tasks related to menu display for circle calculations, character classification, quadratic equation roots, summing natural numbers, calculating factorials, and demonstrating loop control statements. Additionally, it addresses searching for prime numbers, managing lists and tuples, and creating/updating dictionaries with student information.

Uploaded by

zaidumer238
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

QUESTIONS

1). Program to obtain length and breadth of a rectangle and calculate it’s area?

2). Write a program to input two numbers and swap them.


3). Program that takes a number and checks whether the given number is odd
or even?

4). Program to accept three integers and print the largest of three. Make use of
only if statement.
5). Program to test divisibility of a number with another number (i.e. if a
number is divisible by another number.)?

6). Program to display a menu for calculating areas of a circle or circumference


of a circle?
7). Program to print whether a given character in an uppercase or lowercase
character or a digit or any other character?
8). Program to calculate and print roots of a quadratic equation?
9). Program to print sum of natural numbers between 1 to 7. Print the sum
progressively, i.e. after adding each natural number, print sum so far?

10). Program to calculate factorial of a number?


11). Program to illustrate the difference between BREAK & CONTINUE
statements?

Explanation:

• When i becomes 5, the break statement terminates the loop completely.

Explanation:

• When i is 5, the continue statement skips that iteration and proceeds


with the next one.
12). Program that searches for prime number from 15 to 25?

14). Program to search for an element in a given list of numbers?


13). Write a program that displays options for inserting or delketing elements
in a list. If the user?
15). Write a program to input two lists and display the maximum element from
the elements of both the lists combined along with its index in its list?

16). Deleted?
17). Program to print elements of a tuple?

18). A tuple t1 stores (11, 21, 31, 42, 51) where its second last element is
mistyped. Write a program to correct the second last element as 41.
19). Write a program to read roll number and marks of four students and
create a dictionary from it having roll number as keys.

20). Write a program to add new students roll numbers and marks in the
dictionary M created with roll numbers as keys and marks as the values.

ThaNk yOU

You might also like