Blog

python tutorials and learn python

Created with Sketch.

C Program to Calculate Difference Between Two Time Periods

C Program to Calculate Difference Between Two Time Periods In this example, you’ll learn to calculate the difference between two time periods using the user-defined – differenceBetweenTimePeriod function. Example: Calculate the Difference Between Two Time Periods Output Enter start time: Enter hours, minutes and seconds respectively: 12 34 55 Enter stop time: Enter hours, minutes…
Read more

C Program to Add Two Complex Numbers by Passing Structure to a Function

C Program to Add Two Complex Numbers by Passing Structure to a Function This program takes two complex numbers as structures and adds them with the use of functions. Example: Add Two Complex Numbers   Output For 1st complex number Enter real and imaginary part respectively: 2.3 4.5 For 2nd complex number Enter real and…
Read more

C Program to Add Two Distances (in inch-feet) System Using Structures

C Program to Add Two Distances (in inch-feet) System Using Structures This program takes two distances (in an inch-feet system), adds them and displays the result on the To understand this example, you should have the knowledge of following C programming topics: Example: Program to add two distances in an inch-feet system Output Enter information…
Read more

C Program to Store Information of a Student Using Structure

C Program to Store Information of a Student Using Structure Introduction In this C programming tutorial, we will create a program to store information about a student using a structure. A structure is a composite data type in C that allows you to group variables of different data types under a single name. We will…
Read more

C Program to Sort Elements in Lexicographical Order (Dictionary Order)

C Program to Sort Elements in Lexicographical Order (Dictionary Order) This program sorts the 5 strings entered by the user in the lexicographical order (dictionary order). This program takes 5 words (strings) from the user and sorts them in lexicographical order. Example: Sort strings in the dictionary in order Output Enter 5 words: R programming…
Read more

C Program to Copy String Without Using strcpy()

C Program to Copy String Without Using strcpy() In this article, you’ll learn to copy string without using the library function strcpy(). You can use the strcpy() function to copy the content of one string to another but, this program copies the content of one string to another manually without using strcpy() function. Example: Copy…
Read more

C Program to Concatenate Two Strings

C Program to Concatenate Two Strings In this article, you’ll learn to easily concatenate two strings without using the standard library function strcat(). You can concatenate two strings easily using the standard library function strcat() but, this program concatenates two strings manually without using strcat() the function. Example: Concatenate Two Strings Without Using strcat() Output…
Read more

C Program to Find the Length of a String

C Program to Find the Length of a String In this article, you’ll learn to find the length of a string without using strlen() function. You can use the standard library function strlen() to find the length of a string but, this program computes the length of a string manually without using strlen() function. Example:…
Read more

C Program to Remove all Characters in a String Except Alphabets

C Program to Remove all Characters in a String Except Alphabets This program takes a string from user and removes all characters in that string except alphabets. Example: Remove Characters in String Except for Alphabets     This program takes a string from the user and stored it in the variable line.   , within…
Read more

C Program to Count the Number of Vowels, Consonants, and so on

C Program to Count the Number of Vowels, Consonants, and so on This program counts the number of vowels, consonants, digits, and white spaces in a string that is entered by the user. Example: Program to count vowels, consonants, etc. Output Enter a line of string: adfslkj34 34lkj343 34lk Vowels: 1 Consonants: 11 Digits: 9…
Read more