C Program to Find First N Fibonacci Numbers

This C Program calculate the Fibonacci numbers in the series. The first two numbers in the Fibonacci sequence are 0 and 1 and each subsequent number is the sum of the previous two. The formula for this program is: Fn = Fn-1 + Fn-2 Here is source code of the C program to calculate the … Read more

advertisement

C Program to Find the Length of the String

The length of a string can be determined using the built-in library function strlen() in the “string.h” header file. Examples: String: “Hello” Length of the string is: 5 String: “Sanfoundry” Length of the string is: 10 Problem Description Write a C Program to find the length of a String. Problem Solution 1. Take a string … Read more

advertisement

C Program to Check if Two Matrices are Equal

This C Program checks if 2 matrices are equal. Problem Description This C Program checks whether the 2 Matrices are Equal. The program first reads 2 matrices and then checks both the matrices are equal. If both the matrices are equal then display they are equal. If both the matrices are not equal then display … Read more

advertisement

C Program to Find Sum and Difference of Two Matrices

This is a C program used to calculate the sum & difference of the matrices. Problem Description This program calculates the sum & difference of the matrices. The program first reads 2 matrices and then performs both addition and subtraction of matrices. Problem Solution 1. Create four 2D arrays (matrices), 2 for storing data, one … Read more

advertisement

C Program to Read Data from File

This C Program illustrates reading of data from a file. The program opens a file which is present. Once the file opens successfully, it uses libc fgetc() library call to read the content. Here is source code of the C program to illustrate reading of data from a file. The C program is successfully compiled … Read more

advertisement

C Program to Calculate Pow (x,n)

This is a C Program to compute the value of x ^ n. Problem Description This C Program computes the Value of X ^ N. Problem Solution The program uses power function defined in math library. Program/Source Code Here is source code of the C program to computes the Value of X ^ N. The … Read more

advertisement

C Program to Find the Frequency of “the” Word in a String

This is a C program to find the frequency of the word ‘the’ in a given sentence. Problem Description This program takes the sentence as input and finds the frequency of the word ‘the’ in a given sentence. Problem Solution 1. Take any sentence as input. 2. Check for the word ‘the’ in the input … Read more

advertisement

C Program to Create a File and Store Information

This C Program creates a file & store information. We frequently use files for storing information which can be processed by our programs. In order to store information permanently and retrieve it we need to use files and this program demostrate file creation and writing data in that. Here is source code of the C … Read more

advertisement

C Program to Check if a String is a Palindrome without using Built-in Function

This is a C program to check a given string is palindrome without using the Built-in Function. Problem Description This program accepts a string and checks whether a given string is palindrome without using the built-in function. Problem Solution 1. Take a string as input and store it in the array. 2. Reverse the string … Read more

advertisement

C program to Compare Two Strings

Problem Description Write a C Program to compare two strings. What is a String? String is a sequence of characters terminated by the special character ‘\0’. Strings can be compared with or without using the string function. Example: String1=”Hello” String2=”Hello” Both string are equal String1=”Hello” String2=”Hell” String1 is greater String1=”Hello” String2=”Helz” String2 is greater Problem … Read more

advertisement
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 & discussions at Telegram SanfoundryClasses.