C Program to Calculate EMI

What is EMI? Equated Monthly Installments (EMIs) are monthly payments made by borrowers to creditors on a specific date. Over some years, the loan is repaid in full, with EMIs covering both interest and principal. How to Calculate EMI with Example? EMI calculator is used to calculate the per month EMI of the loan amount … Read more


C Program to Remove Duplicate Elements from an Array

What is Array? An array is a collection of similar data elements stored in a contiguous memory location. Example: arr[5] = {2,7,1,23,5} Example: Input Array: 1,2,4,5,4,2,7,5 Output: Resultant Array after removing duplicates: 1,2,4,5,7 Problem Description Write a C Program to remove duplicate elements from an Array. Problem Solution 1. Take size of the array n … Read more


Sparse Matrix Representation in C

Sparse Matrix: A sparse matrix is a matrix with the majority of its elements equal to zero. To identify a sparse matrix, we will check all the elements in the sparse matrix one by one and count the number of 0’s in it if the number of zeros’ is greater than 50% of the total … Read more


C Program to Check Symmetric Matrix

Symmetric Matrix: A square matrix that is equal to its transpose is known as a symmetric matrix. Transpose Matrix: The transpose of a matrix is found by interchanging its rows into columns or columns into rows. The transpose of the matrix is denoted by using the letter “T”. So, a matrix A is said to … Read more


C Program to Implement Binary Tree

Problem Description Write a C program to implement the Binary Tree operations and display its traversals. Outline of a Binary Search Tree: What is a Tree? What is a Binary Tree? Doubly Linked List Representation of a Binary Tree Node Implementation of Binary Tree (Program/Code) Binary Tree – insert() Method Binary Tree – delete() Method … Read more


Hello World Program in C

Printing “Hello World” is the first step we follow in learning any programming language. Printing “Hello World” introduces us to various terminologies associated with a programming language. Problem Description Write a C Program for printing “Hello World”. Problem Solution 1. Declare the header files required for printing “Hello World”. 2. Declare the main function for … Read more


C Program to Calculate Electricity Bill

The electricity bill is calculated by multiplying the unit generated by the cost per unit. ie, if the unit generated is 190(say) and the cost per unit is 10Rs so the total electricity bill is 190×10 = 1900Rs. Although the electric meters installed at our houses read the electricity consumed in kilowatt-hours(kwh) and 1 kwh … Read more


Fizzbuzz Program in C

FizzBuzz is a simple programming task used in software developer job interviews. It is often used as an initial screening question to help filter out candidates who lack basic coding skills. In this task, you are asked to write a program that prints the numbers from 1 to 100. But for multiples of three print … Read more


Pyramid Patterns in C

What is a Pyramid Pattern? A pyramid pattern in a two-dimensional plane is equal to an equilateral triangle. There are many variations of these pyramid patterns such as half pyramid, inverted pyramid, and diamond shape. Let us see how we can draw all these shapes using C language and understand the process. Problem Description Write … Read more


SJF Scheduling Program in C

SJF Scheduling Algorithm: The CPU scheduling algorithm Shortest Job First (SJF), allocates the CPU to the processes according to the process with smallest execution time. SJF uses both preemptive and non-preemptive scheduling. The preemptive version of SJF is called SRTF (Shortest Remaining Time First). Here we will discuss about SJF i.e., the non-preemptive scheduling. Advantages … Read more

Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & technical discussions at Telegram SanfoundryClasses.