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
Server Side Programming Articles
Page 939 of 2109
Program 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 MoreProgram to Print the Squared Matrix in Z form in C
In C programming, printing a squared matrix in Z form means displaying the elements in a specific pattern − first the top row, then the diagonal elements from top-right to bottom-left, and finally the bottom row. This creates a Z-shaped traversal pattern through the matrix. Syntax /* Z-form traversal pattern */ // First row: matrix[0][0] to matrix[0][n-1] // Diagonal: matrix[i][n-1-i] where i goes from 1 to n-2 // Last row: matrix[n-1][1] to matrix[n-1][n-1] Algorithm 1 2 3 ...
Read MoreProgram to print Lower triangular and Upper triangular matrix of an array in C
In C, triangular matrices are special square matrices where elements are zero either above or below the main diagonal. This program demonstrates how to print both lower and upper triangular matrices from a given matrix. Syntax /* Lower Triangular: matrix[i][j] = 0 when j > i */ /* Upper Triangular: matrix[i][j] = 0 when i > j */ Triangular Matrix Types Lower Triangular Matrix − A square matrix where all entries above the main diagonal are zero. Lower Triangular ...
Read More