0% found this document useful (0 votes)
11 views1 page

Exercise 3

Uploaded by

Shailvi Suman
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)
11 views1 page

Exercise 3

Uploaded by

Shailvi Suman
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/ 1

CSIR12 Introduction to computer programming

B.Tech Civil Engineering, Section A


Date: 9th Feb 2024
Exercise 3

1. Write a program to print numbers from 1 to 10 using range function.


2. Write a program to print first 10 even numbers and odd numbers.
3. Write a program to display arithmetic progression of first 20 numbers.
a) a = 1, d = 3
b) a = 5, d = 5
c) a = 100, d = 2
d) a = 100, d = 5
Write algorithm and execute the following programs:
4. Write a program to print the 16th term for the above arithmetic progressions.
5. Write a program to print the following output without hard coding:
a) 1234
(Single line and No space)
b) 1 2 3 4
(Single line with tab space)
c) 1
2
3
4
d) 1-2-3-4
e) 1*2*3*4
f) 1-2-3-4-
g) 1*2*3*4*
6. Write a program to check whether a given number is odd or even? Get input of type int.
7. Find the smallest and largest of three numbers. Get the input from user of type float.
8. Write a program to check if a given number is prime.
9. Write a program to check if a given number is positive, negative or zero.
10. Write a program to print the sum of first n natural numbers. n is the user input of type
int.
11. Write a program to print the factorial of a given number.
12. Write a program to print the Fibonacci sequence.

You might also like