C Programming Assignment Questions

 

Loop Assignment Questions:

1. Print the numbers from 1 to 100 but skip the multiples of 5
Ex;- 1, 2, 3,4, 6, 7,8,9,11,12,13,14,16,… 99

2. Program to find the sum & avg of 10 positive integers
10, 110,45,87,9,450,23,92,134,678 = sum avg

3. Print the below pyramid
5
4 4
3 3 3
2 2 2 2
1 1 1 1 1

4. Write a program to print all prime numbers from 1 to 99
Output : 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97

5. Write a program to find whether the given number is palindrome or not ?
Ex:- 4526254 Is a palindrome number
12334 is not a palindrome number

6. Input a number & a digit, and count the number of times the digit occurs in the number
Ex:- input number is 12341321  and the digit is 1 & the output is 3
3 times 1 present in the given number

7. Print the square box using *
Example:- given number is 4 
 ****
*     *
*     *
*     *
*     *
 ****


Function Assignment

1. Wap to implement simple calculator using functions. Each operation should be done in separate function.
2. Wap to implement students mark list using functions. Each operation should be done in separate function.
3. Wap to implement some common functions. Each operation should be done in separate function.
a) Fibonacci
b) Factorial
c) Palindrome
4. Wap to print all prime numbers from given range(must use functions)
ex: 100 to 2000 
output: print all prime numbers from 100 to 2000
5. Wap to implement these formula of permutations & combinations
p(n,r) = n!/(n-r)!  n= 5, r = 3=>  5!/(2!) =120/2 = 60
c(n,r) = p(n,r)/r!  = n!/(r!*(n-r)!)
Get 2 inputs from user n & r 
need to use 3 functions.

Recursive method Assignment

1. Print numbers from -20 to +20 using recursive method
2. Print numbers from 100 to 1 using recursive method
3. Print multiplication table using recursive method 
4. Write a recursive method to print this pyramid
1
1 2
1 2 3
1 2 3 4 

Comments

Popular posts from this blog

C Programming Language Tutorial

Micro Controller Notes