C Program to demonstrate functions.

C Program to demonstrate functions. C Functions are block of codes, performs the specific task. Default function in C is main(). Advantages of the functions are easy to understand, coding, well defined tasks, easy error handling. There are several ways to call the functions like, pass by value, pass by reference etc.. Read more about …

C Program to demonstrate the ‘atof’ and ‘gets’ functions.

C Program to demonstrate the ‘atof’ and ‘gets’ functions. atof function converts the intial nptr string to the double. atof means ASCII to float. gets function reads string from the input stream. puts function prints string to the output stream This program will multiply to floating point numbers. The program will accept invalid data, and …

C Program to Demonstrate getting the parameters from the command line.

C Program to getting the parameters from the command line. To pass the arguments from command line, in main function we have to declare two arguments . First one is number of arguments passed to the program and other one is pointer variable which gives the list of arguments passed. Read more about C Programming …

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 …

C Program to compare two strings

C Strings: C Program to accepts two strings and compare them, Finally it prints whether both are equal, or first string is greater than the second or the first string is less than the second string. The string comparison starts with the first character in each string and continues with subsequent characters until the corresponding …

C Program to implement strlen function

Write a c program to find the length of a string without using the built-in function strlen(). Program will calculate the length of the string using for loop by going through each character of the string, till its end. Read more about C Programming Language . /************************************************************ You can use all the programs on www.c-program-example.com* …

C Program to convert days to years, weeks and days

Write a C Program to convert given number of days to a measure of time given in years, weeks and days. For example 375 days is equal to 1 year 1 week and 3 days (ignore leap year).Read more about C Programming Language . /************************************************************ You can use all the programs on www.c-program-example.com* for personal …

C Program to accept a string and a substring and check if the substring is present in the given string

C Strings:Write a C program to accept a string and a substring and check if the substring is present in the given string. Program search’s given substring is in the string or not, and prints the appropriate message. Read more about C Programming Language . /************************************************************ You can use all the programs on www.c-program-example.com* for …