Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by suresh kumar
12 articles
Program to print Square inside a Square in C
In C, printing a square inside a square involves creating a pattern where two square borders are drawn using nested loops. The outer square forms the boundary, while an inner square is positioned within it, creating a nested square pattern. Syntax for (row = 1; row
Read MoreProgram to print solid and hollow rhombus patterns in C
A rhombus pattern in C is a diamond-like shape created using stars (*). There are two types: solid rhombus (completely filled with stars) and hollow rhombus (only the border is filled with stars). Syntax // Nested loops to create rhombus pattern for(row = 1; row
Read MoreProgram to print right and left arrow patterns in C
In C programming, arrow patterns are visual designs created using nested loops and asterisks. This program demonstrates how to create both left and right arrow patterns using stars and spaces. Syntax for(row = 1; row
Read MoreProgram to print pyramid pattern in C
A pyramid pattern is a triangular arrangement of characters (usually stars or numbers) where each row has an increasing number of elements, creating a pyramid-like shape. This is a fundamental pattern printing problem in C programming. * * * * * * * * * * * * * * * Pyramid Pattern (5 rows) Syntax for(row = 1; row
Read MoreProgram to print pentatope numbers upto Nth term in C
A pentatope number is a figurate number that represents the number of points in a pentatope (4-dimensional simplex). These numbers form the fifth diagonal of Pascal's triangle. The nth pentatope number represents the number of ways to choose 4 items from n+3 items. Syntax pentatope(n) = n * (n + 1) * (n + 2) * (n + 3) / 24 Mathematical Formula The formula for the nth pentatope number is − pentatope(n) = C(n+3, 4) = n * (n + 1) * (n + 2) * (n + 3) / 24 ...
Read MoreProgram to print numbers columns wise in C
In C programming, we can create patterns where natural numbers are arranged column-wise in a triangular format. This pattern displays numbers in columns, where each row contains one more number than the previous row. Pattern Description The pattern arranges numbers as follows − 1 2 6 3 7 10 4 8 11 13 5 9 12 14 15 Each number is placed based on its column position, creating a triangular arrangement where numbers flow vertically in columns. Algorithm The algorithm uses the following approach − i represents the current row ...
Read MoreProgram to print number pattern in C
Numerical patterns in C programming involve printing sequences of numbers arranged in specific shapes or structures. These patterns follow mathematical rules and are excellent for practicing nested loops and logical thinking. Syntax for(i = start; condition; increment/decrement) { for(j = start; condition; increment/decrement) { printf("format", value); } printf(""); } Example 1: Triangular Number Pattern This pattern displays numbers in a triangular format where each row contains specific values based on a mathematical formula − #include int main() { int i, j, k; printf("Triangular Number Pattern:"); for(i = 1; i
Read MorePrint the Non Square Numbers in C
In C programming, a perfect square is an integer that is the square of another integer. For example, 1, 4, 9, 16, 25 are perfect squares because they equal 1², 2², 3², 4², 5² respectively. Non-square numbers are all other positive integers that are not perfect squares. Syntax #include int sqrt(double x); // Returns square root of x Perfect Square Numbers The first few perfect squares are − 1, 4, 9, 16, 25, 36, 49, 64, 81, 100 These correspond to − 1² = 1, 2² ...
Read MoreProgram to Print Mirrored Hollow Parallelogram in C
A mirrored hollow parallelogram is a pattern where a hollow parallelogram shape is printed with leading spaces to create a mirrored or slanted effect. The pattern consists of stars forming the outline while the interior remains hollow. Syntax for(r = 1; r
Read MorePrint the Mirror Image of Sine-Wave Pattern in C
In C programming, creating a mirror image of a sine-wave pattern involves printing a visual representation where waves appear to be reflected. This pattern uses the mathematical concept of symmetry to create wave-like shapes using characters. Syntax for(i = 1; i
Read More