a program in c language to print the pattern of a diamond using a for loop.


Explanation
1. Take number of rows as input and store it in variable number.
2. First, reduce the variable number by 1 and put this value in count variables.
3. Use count variable as terminator in for loop to show “ “.
4. Reduce the of count variable by 1.
5. Use another loop to start from 1 to (2*k-1) to display "*".
6. Perform steps 3, 4, and 5 within the for loop, starting from 1 up to the variable number.
7. Steps 2 to 6 are used to print half of the diamond.
8. For the next half, variable count is assigned by 1.
9. Use this count variables as a terminator in the for loop for printing “ “.
10. Increase the count variable by 1.
11. Use another loop to start from 1 to (2*(number-k)-1) to show "*".
12. Perform steps 8 to 11 inside a for loop from 1 to value (number 1).


Previous :-->> 12.Write a program in c to check if a given number is a strong number or not using a while loop.
 -->> NEXT: 14.Write a program in c language to check if a given number is a palindrome or not using a while loop.
-->>ALL Loops Assignments in c