Practice Problems for Week-3
Problems related Loops and Nested loops.
1. Write a C program to check whether a number is Prime number or not.
2. Write a C program to find sum of all prime numbers between 1 to n.
3. Write a C program to print Fibonacci series up to n terms.
4. Write a C program to convert Decimal to Binary number system.
5. Write a C program to convert Binary to Decimal number system.
6. Printing some star pattern.
***** * ***** ***** *****
***** ** **** **** *****
***** *** *** *** *****
***** **** ** ** *****
***** ***** * * *****
7. Printing some number pattern.
11111 01010 11111 11111 12345 12345 1
00000 01010 10001 11111 23456 23451 21
11111 01010 10001 11011 34567 34521 321
00000 01010 10001 11111 45678 45321 4321
11111 01010 11111 11111 56789 54321 54321
8. Printing more patterns.
5 5 5 5 5 5 5 5 5 1 01 02 03 04 05 5 1
5 4 4 4 4 4 4 4 5 12 16 17 18 19 06 45 131
5 4 3 3 3 3 3 4 5 1234 15 24 25 20 07 345 13531
5 4 3 2 2 2 3 4 5 12345 14 23 22 21 08 2345 1357531
5 4 3 2 1 2 3 4 5 1234 13 12 11 10 09 12345 135797531
5 4 3 2 2 2 3 4 5 123
5 4 3 3 3 3 3 4 5 12
5 4 4 4 4 4 4 4 5 1
5 5 5 5 5 5 5 5 5
* 55555 1
*1* 54444 11
*121* 54333 101
*12321* 54322 1001
*1234321* 54321 11111
*12321*
*121*
*1*
*