Category Archives: C Programs

C Programs

C Program to Print Hollow Box Number Pattern

C Program to Print Hollow Box Number Pattern

In this tutorial, we will learn to create a C program that will Print a Hollow Square in C programming

Prerequisites

Before starting with this tutorial, we assume that you are the best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C programming.
  • For loop in C programming.

What is Hollow Square?

The hollow square is a square. Made in the c programming language. The hollow square has only four borderlines of the square. It is not filled from the inner section.

Algorithm:-

Program description Printing a Hollow Square:-

In this program, we will first take the input size of the side of the square. Then we will use nested for loops for the program to print the hollow square. We will print the borders only for the shape.  So that we can create a hollow shape. At last, the loop will print the square row by row.

The below is an example of the square program code.

Program Code:-

 

Output:-

In the above program, we have last initialized the required variable.

  • Side = it will hold the integer value.
  • j = it will hold the integer value.
  • i = it will hold the integer value.

Input the number of rows for the pattern.

Code to make the pattern on the screen.

Printing output pattern using c programming.

C Program to Print 1 and 0 in Alternative Rows

C Program to print 1 and 0 in Alternative Rows

In this tutorial, we will learn to create a C program that will print 1 and 0 in Alternative Rows in C programming.

Prerequisites

Before starting with this tutorial, we assume that you are the best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C programming.
  • For loop in C programming.

Algorithm:-

Program description:-

The alternative pattern means the printing of data in an alternate format, one time it returns 1 in one row, and the next time it returns 0 in another row. The alternative pattern is made using C programming.

In today’s program, we will first take the input rows and columns from the user. Then we will print the alternative pattern using the for loop containing the 0 and 1 in rows.

The below is an example of the pattern program code filled with numbers.

Program Code:-

Output:-

In the above program, we have last initialized the required variable.

  • rw = it will hold the integer value.
  • cl = it will hold the integer value.
  • j = it will hold the integer value.
  • i = it will hold the integer value.

Input the number of rows for the pattern.

Code to make the pattern on the screen.

Printing output pattern using c programming.

C program to print 1 and 0 in Alternative Columns

C Program to print 1 and 0 in Alternative Columns

In this tutorial, we will learn to create a C program that will print 1 and 0 in Alternative Columns in C programming.

Prerequisites

Before starting with this tutorial, we assume that you are the best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C programming.
  • For loop in C programming.

What is an Alternative pattern?

The alternative pattern means the printing of data in an alternate format, one time it returns 1, and the next time it returns 0. The alternative pattern is made using C programming.

Algorithm:-

Program description:-

In today’s program, we will first take the input rows and columns from the user. Then we will print the alternative pattern using the for loop containing the 0 and 1 in rows and columns.  The below is an example of the pattern program code filled with numbers.

Program Code:-

Output:-

In the above program, we have last initialized the required variable.

  • rw = it will hold the integer value.
  • cl = it will hold the integer value.
  • j = it will hold the integer value.
  • i = it will hold the integer value.

Input the number of rows for the pattern.

Code to make the pattern on the screen.

Printing output pattern using c programming.

C Program to Print Consecutive Column Numbers in Right Triangle

C Program to Print Consecutive Column Numbers in Right Triangle

In this tutorial, we will learn to create a C program that will print Consecutive Column Numbers in Right Triangle in C programming.

Prerequisites

Before starting with this tutorial, we assume that you are the best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C programming.
  • For loop in C programming.

Algorithm:-

Program description:-

In today’s program, we will first take the input rows from the user. Then we will print the Consecutive numbers from 1 to ending using the for a loop.  Then we will print the right angle triangle pattern filled with the Consecutive Numbers.

The Consecutive pattern means the printing of data in a sequential format, one time it returns 1, and the next time 2 then 3, and so on. The Consecutive pattern triangle contains numbers from 1 to the satisfying point.

The below is an example of the right triangle pattern program code filled with Consecutive numbers in the Column.

Program Code:-

Output:-

In the above program, we have last initialized the required variable.

 

  • rw = it will hold the integer value.
  • k = it will hold the integer value.
  • j = it will hold the integer value.
  • i = it will hold the integer value.

Input the number of rows for the pattern.

Code to make the print Consecutive Row Numbers in Right Triangle.

Printing Consecutive Row Numbers in Right Triangle.

C Program to Print Consecutive Row Numbers in Right Triangle

C Program to Print Consecutive Row Numbers in Right Triangle

In this tutorial, we will learn to create a C program that will print Consecutive Row Numbers in Right Triangle in C programming.

Prerequisites

Before starting with this tutorial, we assume that you are the best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C programming.
  • For loop in C programming.

What is a consecutive pattern?

The Consecutive pattern means the printing of data in a sequential format, one time it returns 1, and the next time 2 then 3, and so on. The Consecutive pattern triangle contains numbers from 1 to the satisfying point.

Algorithm:-

Program description:-

In today’s program, we will first take the input rows from the user. Then we will print the Consecutive numbers from 1 to ending using the for loop.  Then we will print the right angle triangle pattern filled with the Consecutive Numbers.

The below is an example of the right triangle pattern program code filled with Consecutive numbers.

Program Code:-

Output:-

In the above program, we have last initialized the required variable.

 

  • rw = it will hold the integer value.
  • k = it will hold the integer value.
  • j = it will hold the integer value.
  • i = it will hold the integer value.

Input the number of rows for the pattern.

Code to make the print Consecutive Row Numbers in Right Triangle.

Printing Consecutive Row Numbers in Right Triangle.

C program to print Right Triangle of Numbers in Decreasing order

C Program to Print Right Triangle of Numbers in Decreasing order

In this tutorial, we will learn to create a C program that will print the Right Triangle of Numbers in Decreasing order in C programming

Prerequisites

Before starting with this tutorial we assume that you are best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C programming.
  • For loop in C programming.
  • Conditional Statements in C programming.

What is a decreasing order?

The decreasing order means the numbers will be in the form of largest to the smallest number, from the given number to 1.

It means if the given number is 9 then the triangle will be like 

9

8

7

6

5

4

3

2

1

Algorithm:-

Program description that will print a Right Triangle of Numbers in Decreasing order:-

In today’s tutorial, we will create a program, that will print a right angle triangle of Numbers in Decreasing order using for loop taking the rows from the user. First, take the input number of rows in the triangle by the user. Then we will print the right angle triangle of Numbers using the for-loop. The below is an example to print a right-angle triangle of Numbers.

Program Code:-

Output:-

In the above program, we have Last initialized the required variable.

 

  • rw = it will hold the integer value.
  • j = it will hold the integer value.
  • i = it will hold the integer value.

Input the number of rows for the pattern.

Code to make the pattern on the screen.

Printing output pattern using c programming.

C Program to Print Right Triangle of Incremented Numbers

C Program to Print Right Triangle of Numbers in Incremented order

In this tutorial, we will learn to create a C program that will print the Right Triangle of Numbers in Incremented order in C programming.

Prerequisites

Before starting with this tutorial we assume that you are best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C programming.
  • For loop in C programming.
  • Conditional Statements in C programming.

What is a Right Angled Triangle?

This triangle plays an important role in trigonometry. A right-angled triangle is a triangle, that has one of its interior angles equal to 90 degrees or a right angle. Therefore, this triangle is also called the right triangle or 90-degree triangle.

What is a pattern?

The patterns can be any shape or design drawn on the screen i.e. triangle, rectangle, pyramid, any other shape. In the C programming language, the patterns are generated using loops and iterative statements.

Algorithm:-

Program description that will print a Right Triangle of Numbers in Ascending order:-

In today’s tutorial, we will create a program, that will print a right angle triangle of Numbers in ascending order using for loop taking the rows from the user. First, take the input number of rows in the triangle by the user. Then we will print the right angle triangle of Numbers using the for-loop. The below is an example to print a right-angle triangle of Numbers.

Program Code:-

Output:-

In the above program, we have Last initialized the required variable.

 

  • rw = it will hold the integer value.
  • j = it will hold the integer value.
  • i = it will hold the integer value.

Input the number of rows for the pattern.

Code to make the pattern on the screen.

Printing output pattern using c programming.

C Program to Print Inverted Right Triangle Number Pattern

 

C Program to Print Inverted Right Triangle Number Pattern

In this tutorial, we will learn to create a C program that will print the Inverted Right Triangle Number Pattern in C programming

Prerequisites

Before starting with this tutorial, we assume that you are the best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C programming.
  • While loop in C programming.
  • Conditional Statements in C programming.

What is an Inverted Right Angled Triangle?

This right-angle triangle is a flip triangle created using a reverse while loop. It has a base on the top side, and it is 90 Degree triangle following the Pythagoras theorem.

What is a pattern?

The patterns can be any shape or design drawn on the screen i.e. triangle, rectangle, pyramid, any other shape. In the C programming language, the patterns are generated using loops and iterative statements.

Algorithm:-

Program description that will print the Inverted Right Triangle Number Pattern:-

In today’s tutorial, we will create a program, that will print the Inverted Right Triangle Number Pattern using a while loop. First, take the input number of rows in the triangle by the user. Then we will print the right angle triangle of Numbers using the for-loop. The below is an example to print an Inverted Right Triangle Number Pattern.

Program Code:-

Output:-

In the above program, we have Last initialized the required variable.

 

  • rw = it will hold the integer value.
  • j = it will hold the integer value.
  • i = it will hold the integer value.

Input the number of rows for the pattern.

Code to make the pattern on the screen.

Printing output pattern using c programming.

C Program to Print Numeric Right Triangle Pattern 3

C Program to Print Right Triangle Number Pattern 3

In this tutorial, we will learn to create a C program that will print the Right Triangle Number Pattern 3 in C programming

Prerequisites

Before starting with this tutorial, we assume that you are the best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C programming.
  • For loop in C programming.
  • Conditional Statements in C programming.

Algorithm:-

Program description that will print the Right Triangle Number Pattern 3:-

A right-angled triangle is a triangle, that has one of its interior angles equal to 90 degrees. This triangle plays an important role in trigonometry. In today’s tutorial, we will create a program, that will print the Right Triangle Number Pattern 3 using a while loop taking the rows from the user. First, take the input number of rows in the triangle by the user. Then we will print the simple right-angle triangle of Numbers using the for-loop. The below is an example to print a Right Triangle Number Pattern 3.

Program Code:-

 

Output:-

In the above program, we have Last initialized the required variable.

 

  • rw = it will hold the integer value.
  • j = it will hold the integer value.
  • i = it will hold the integer value.

Input the number of rows for the pattern.

Code to make the pattern on the screen.

Printing output pattern using c programming.

C Program to Print Numeric Right Triangle Pattern 2

C Program to Print Right Triangle Number Pattern 2

In this tutorial, we will learn to create a C program that will print the Right Triangle Number Pattern 2 in C programming

Prerequisites

Before starting with this tutorial we assume that you are best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C programming.
  • While loop in C programming.
  • Conditional Statements in C programming.

What is Right Angled Triangle?

This triangle plays an important role in trigonometry. A right-angled triangle is a triangle, that has one of its interior angles equal to 90 degrees or a right angle. The right-angle triangle follows the Pythagoras theorem. Therefore, this triangle is also called 90-degree triangle.

Algorithm:-

Program description that will print the Right Triangle Number Pattern 2:-

In today’s tutorial, we will create a program, that will print the Right Triangle Number Pattern 2 using a while loop taking the rows from the user. First, take the input number of rows in the triangle by the user. Then we will print the simple right-angle triangle of Numbers using the for-loop. The below is an example to print a Right Triangle Number Pattern 2.

Program Code:-

 

Output:-

In the above program, we have Last initialized the required variable.

 

  • rw = it will hold the integer value.
  • j = it will hold the integer value.
  • i = it will hold the integer value.

Input the number of rows for the pattern.

Code to make the pattern on the screen.

Printing output pattern using c programming.

C Program to Print Right Triangle Number Pattern

C Program to Print Right Triangle Number Pattern

In this tutorial, we will learn to create a C program that will print the Right Triangle Number Pattern in C programming

Prerequisites

Before starting with this tutorial, we assume that you are the best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C programming.
  • While loop in C programming.
  • Conditional Statements in C programming.

What is Right Angled Triangle?

This triangle plays an important role in trigonometry. A right-angled triangle is a triangle, that has one of its interior angles equal to 90 degrees or a right angle. Therefore, this triangle is also called the right triangle or 90-degree triangle.

Program description that will print the Right Triangle Number Pattern:-

In today’s tutorial, we will create a program, that will print the Right Triangle Number Pattern using a while loop.

First, take the input number of rows in the triangle by the user. Then we will print the simple right-angle triangle of Numbers using the for-loop. The below is an example to print a Right Triangle Number Pattern.

Program Code:-

Output:-

In the above program, we have Last initialized the required variable.

 

  • rw = it will hold the integer value.
  • j = it will hold the integer value.
  • i = it will hold the integer value.

Input the number of rows for the pattern.

Code to make the pattern on the screen.

Printing output pattern using c programming.

C Program to Print Triangle Alphabets Pattern

C Program to Print Triangle Alphabets Pattern

In this tutorial, we will learn to create a C program that will print the Triangle Alphabets Pattern in C programming

Prerequisites

Before starting with this tutorial we assume that you are best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C programming.
  • While loop in C programming.
  • Conditional Statements in C programming.

Algorithm:-

Program description that will print the Triangle Alphabets Pattern:-

In today’s tutorial, we will create a program, that will print the Triangle Alphabets Pattern using a while loop taking the rows from the user. First, take the input number of rows in the triangle by the user. Then we will print the simple right-angle triangle of Alphabets using the for-loop. The below is an example to print a Triangle Alphabets Pattern.

Program Code:-

Output:-

In the above program, we have Last initialized the required variable.

  • rw = it will hold the character value.
  • alp = it will hold the character value.
  • j = it will hold the integer value.
  • i = it will hold the integer value.

Input the number of rows for the pattern.

Code to make the pattern on the screen.

Printing output pattern.