You are on page 1of 1

Date: 8/12/2022

IIITT – First Year / List of programs for students with Computer Programming
background
1. Given an integer n, count the total number of digit 1 appearing in all non-negative
integers less than or equal to n. For example: Given n = 13, Return 6, because digit 1
occurred in the following numbers: 1, 10, 11, 12, 13.
2. Write a C program to find the sum of digits of a given integer until the sum yields a
single digit (Ex. 166, 1+6+6=13, 1+3=4).
3. Write a C program to print three numbers in ascending order without sorting.
4. Write a C program to generate all the prime numbers between 1 and n, where n is a value
supplied by the user.
5. Write a C program to construct a pyramid of numbers (n lines).
7
6 7
5 6 7
4 5 6 7
3 4 5 6 7
2 3 4 5 6 7
1 2 3 4 5 6 7

IIITT – First Year / List of programs for students without Computer Programming
background
1. Write a program in c to print the scanned int, float and characted value on the screen
2. Write a program in c to perform addition, subtraction, multiplication and division on
input values and print the result.
3. Write a c program to calculate Simple Interest using the formula
4. Write a c program to print the following pattern
*
* *
* * *
* * * *
5. Find the square and cube of a given number and print the result
6. Find sum and average of ‘n’ numbers and print the result.

You might also like