Category: C programming

python tutorials and learn python

Created with Sketch.

C program to print Armstrong numbers

C Program to Print Armstrong Numbers In this comprehensive blog post, we will delve into the concept of Armstrong numbers and present a C program that identifies and prints Armstrong numbers within a specified range. The article will not only include the complete C program but will also provide detailed explanations of the Armstrong number…
Read more

Fibonacci series in C

  Fibonacci series in C Fibonacci series in C language using a loop and recursion. You can print as many terms of the series as required. The numbers of the sequence are known as Fibonacci numbers. The first few numbers of the series are 0, 1, 1, 2, 3, 5, 8, …,. Except for the…
Read more

Floyd’s triangle in C

  Floyd’s triangle in C C program to print Floyd’s triangle: a user inputs how many rows of the triangle to print. The first four rows of Floyd’s triangle are: 1 2 3 4 5 6 7 8 9 10 In Floyd’s triangle, the nth row contains n numbers. C program to print Floyd’s triangle…
Read more

Pascal triangle in C

  Pascal triangle in C Pascal triangle C program: C program to print the Pascal triangle that you might have studied while studying Binomial Theorem in Mathematics. A user will enter how many numbers of rows to print. The first four rows of the triangle are: 1 1 1 1 2 1 1 3 3…
Read more

C program to add two numbers using pointers

  C program to add two numbers using pointers C program for the addition of two numbers using pointers. In the program, we have two integer variables x and y and two pointer variables p and q. We assign the addresses of x and y to p and q respectively and then assign the sum…
Read more

C program to find maximum element in an array

  C program to find maximum element in an array C program to find the maximum or the largest element and the location (index) at which it’s present in an array. The algorithm to find maximum is: we assume that it’s present at the beginning of the array and stores that value in a variable.…
Read more

C program to find minimum element in the array

  C program to find minimum element in the array C program to find minimum or the smallest element in an array. It also prints the location or index at which the minimum element occurs in the array. Our algorithm assumes the first element as minimum and then compare it with other elements if an…
Read more

Linear search in C

  Linear search in C Linear search in C to find whether a number is present in an array. If it’s present, then at what location it occurs. It is also known as a sequential search. It is straightforward and works as follows: we compare each element with the element to search until we find…
Read more

Binary search in C

  Binary search in C Binary search in C language to find an element in a sorted array. If the array isn’t sorted, you must sort it using a sorting technique such as merge sort. If the element to search is present in the list, then we print its location. The program assumes that the…
Read more

C program to reverse an array

  C program to reverse an array C program to reverse an array: This program reverses the array elements. For example, if ‘A’ is an array of integers with three elements such that A[0] = 1, A[1] = 2, A[2] = 3 Then after reversing, the array will be A[0] = 3, A[1] = 2,…
Read more