Sum of Elements in a Matrix in C – Row, Column, and Total

A matrix is a 2D array of numbers arranged in rows and columns. Finding the sum of its elements — row by row, column by column, or all at once — is one of the most common matrix operations and a good exercise in nested loops and function design. This post shows two approaches: a …

C Program To Sort Names

Write a C program to read N names, store them in the form of an array and sort them in alphabetical order.Output the given names and the sorted names in two columns side by side with suitable heading.Program will sort the name strings using Bubble Sort technique. Read more about C Programming Language . /************************************************************ …

C Program To Demonstrate Linear search

Linear search (also called sequential search) is the simplest searching algorithm: start at the first element, compare each element to the key, and stop when you find a match or exhaust the array. It makes no assumption about the data being sorted. It runs in O(n) time and O(1) space — no extra memory needed …

C Program to Find Sum and Average of an Array

C Program to Find Sum and Average of an Array This program reads N integers (positive, negative, and zero) into an array and computes three values: the sum of negatives, the sum of positives, and the average of all elements. Algorithm Read N (array size) from the user. Read N integers into the array one …

C Program to Find the Value of cos(x) Using Series

This C program computes the value of cos(x) by summing its Taylor series up to a given accuracy, then checks the result against the built-in cos() library function. It’s a great exercise in loops, floating-point arithmetic, and how mathematical functions are actually approximated inside a computer. The Cosine Series The Taylor series for cosine (with …

C program to find the value of sin(x)

This C program computes the value of sin(x) by summing its Taylor series up to a given accuracy, then compares the result with the built-in sin() library function. It’s a classic exercise in loops, floating-point math, and how a computer approximates trigonometric functions. The Sine Series The Taylor series for sine (with x in radians) …