C Program to reverse the first n characters in a file.

C Program to reverse the first n characters in a file using the command line arguments. Here we read the file name and n are specified on the command line. If file exists, it reverse the n characters, else it gives the error message. Read more about C Programming Language . /************************************************************ You can use …

C program which copies one file contents to another file.

C Program which copies one file contents to another file. Here we read the one file and copies the characters to another file which are existed in the disc. Here we read the file names from the command line.Read more about C Programming Language . /************************************************************ You can use all the programs on www.c-program-example.com* for …

C Program to generate random numbers.

C Program to generate random numbers. Random Numbers are numbers which are produced by a process and its outcome is unpredictable.The function srand() is used to seed the random sequence. The rand() function shall compute a sequence of pseudo-random integers in the range [0, {RAND_MAX}] with a period of at least 2^32. Read more about …

C Program to show Sleep() function example.

C Program to show Sleep() function example. sleep() function stops the execution of the program, wherever its invoked or called. It takes the arguments in microseconds. In Windows we use Sleep() function i,e ‘S’, and for other systems it is sleep() function. /*********************************************************** * You can use all the programs on www.c-program-example.com * for personal …

C Program to perform complex numbers operations using structure.

C Program to perform complex numbers operations using structure. Complex numbers are numbers which contains two parts, real part and imaginary part. Complex numbers are written as a+ib, a is the real part and b is the imaginary part. We used the structure in C to define the real part and imaginary part of the …

C Program to convert a Roman numeral to its decimal equivalent.

C Program to convert a Roman numeral to its decimal equivalent. Roman numbers are the oldest number system used in ancient Rome. They use the combination of letters from Latin alphabet to represent the system. We used the if-else and for statements to solve this problem. Read more about C Programming Language . /************************************************************ You …

C program to find the 2’s complement of a binary number.

C Program to calculate the 2’s complement of a binary number. 2’s complement of a number is obtained by scanning it from right to left and complementing all the bits after the first appearance of a 1. Thus 2’s complement of 11100 is 00100. Read more about C Programming Language . /************************************************************ You can use …

C program to delete n Characters from a given position in a given string.

C Strings:C Program to delete the n characters from a given position from a given string. Here we use the gets() and puts() functions to read and write the string. delchar() function reads the character string and checks the length and position, then using strcpy() function it replaces the original string.Read more about C Programming …

C program to insert a sub-string in to given main string from a given position.

C Strings:C Program to insert a sub-string in to given main string from a given position. In this program we read two strings and replace the second string in the given position of the first string.Read more about C Programming Language . /************************************************************ You can use all the programs on www.c-program-example.com* for personal and learning …

C program to find the distance traveled at regular intervals of time given .

C program to find the distance traveled at regular intervals of time given the values of ‘u’ and ‘a’. The program should provide the flexibility to the user to select his own time intervals and repeat the calculations for different values of ‘u’ and ‘a’. Read more about C Programming Language . /************************************************************ You can …