You are on page 1of 11

Q NO.

1) Write a program that uses a function to calculate and return


simple interest with given principal, rate, and time.
Q NO. 2) Write a program that uses two functions to convert temperature from
Celsius to Fahrenheit and vice versa, respectively and return the converted
values.
Q NO.3) Given a positive integer n, write a program to calculate and
return the sum of natural numbers up to n using loops.
QNO.4) Write a program that takes n as user input and determines if it
is even or odd.
`
Q NO. 5) Write a program to calculate the factorial of a number
using a for loop and return its value.
Q NO. 6) Write a program to traverse an array and print the odd-
indexed elements.
Q NO. 7) Write a program that uses for loops to find the largest
element in a 1-D array and returns it.
Q NO.8) Write a program to calculate and return the sum of elements of
a 1-D array.
Q NO.9) Write a program to find average, max and min elements from
an array of n long integers.
Q NO.10) Write a program that uses two functions to swap two
numbers
(A) Using a third variable
(B) Using a third variable

You might also like