Addition of two numbers in C Programming

Addition of two numbers in C Programming is basic and simple task. We can create it very easily. Writing a program is based on Algorithm. An algorithm is step by step description of program. So before writing program we must write algorithm to develop this program. There are different ways to represent an algorithm 1 … Read more

Break and Continue Statement in C with Example

Break and Continue Statement in C are looping control statements. Based on break and continue statement loop can be break or skipped break and continue both are keywords. break – Uses to break the loop also use with switch to break the switch case. continue– skip the current execution of loop and transfer control to … Read more

Count Repeated Elements in an Array in C Programming

Count Repeated Elements in an Array is generally ask in interviews. This problem can be solved in any language. Here we will discuss algorithm to count repeated elements and implement it on C programming. What is Repeated Elements Repeated elements are elements that occurs more than one time in a list or in a sequence. … Read more

Primitive Data Types in C Programming

1. What is data type in C Data type specifies what type of data a variable can hold. There are four category of data type in C language.  They are as follows: Types Data Types Basic (Primitive) data types int, char, float, double Enumeration data type Enum Derived data type pointer, array, structure, union Void … Read more

Command Line Argument in C Programming

In a C programming often a situation may come where we want to pass the information into a program during the execution of program. These values are called Command Line Arguments(CLA). “main()” function handles the command line argument. Syntax: int main( int argc, char *argv[] ) { } Here, argc refers to the number of arguments passed  … Read more

File handling programs in C Programming

Example : Write a C program to copy the contents of one file to another file.


Example : Write a C program to appends the content of file at the end of another file. Or  Example : Write a C program to merge two files into third file.

Example: Write a C program … Read more

Writing to a File in C Programming

To write on a file there are following  function available:  Function fputc() : function fputc() write individual characters at a time to the file. The syntax of this function is – Syntax :                int  fputc( int c,  FILE *fp ); Function fputc()  returns the written character written on success and  if there is an error it will return … Read more