C program to add two numbers

Write a C program to input two numbers from user and calculate their sum. C program to add two numbers and display their sum as output. How to add two numbers in C programming.

Example
Input

Input first number: 20
Input second number: 10

Output

Sum = 30

Read more

How to find the size of data type using sizeof() operator in C

Sizeof(type) is a unary operator used to calculate the size(in bytes) of any datatype in C. Syntax: sizeof(type)Note: type must be replaced by a valid C data type or variable. Example: #include <stdio.h>int main(){ int i; printf(“Size of int = %dn”, sizeof(int)); printf(“Size of i = %dn”, sizeof(i)); return 0;} Output: Size of int = … Read more

C program to convert string to lowercase

Write a C program to convert uppercase string to lowercase using for loop. How to convert uppercase string to lowercase without using inbuilt library function strlwr(). How to convert string to lowercase using strlwr() string function.

Example

Input

Input string: I love CODEFORWIN.

Output

Lowercase string: i love codeforwin.

Read more

C program to convert lowercase string to uppercase

Write a C program to convert string from lowercase to uppercase string using loop. How to convert string from lowercase to uppercase using for loop in C programming. C program to convert lowercase to uppercase string using strupr() string function.

Example

Input

Input string: I love Codeforwin.

Output

I LOVE CODEFORWIN.

Read more

C program to find reverse of a string

Write a C program to find reverse of a given string using loop. How to find reverse of any given string using loop in C programming. Logic to find reverse of a string without using strrev() function in C. C program to reverse a string using strrev() string function.

Example

Input

Output

Reverse string: olleH

Read more

C program to count total number of vowels and consonants in a string

Write a C program to find total number of vowels and consonants in a string using loop and if else. How to find total number of vowels and consonants in a string using switch case in C programming. Logic to count number of vowels and consonants in a string.

Example

Input

Input string: I love Codeforwin.

Output

Total Vowels = 7
Total Consonants = 8

Read more

C program to find length of a string

Write a C program to find length of a string using loop. How to find length of a string without using in-built library function strlen() in C programming. Effective way to find length of a string without using strlen() function. How to find length of a string using strlen() string function.

Example

Input

Input string: I love programming. I love Codeforwin.

Output

Length of string: 38

Read more

C program to count number of words in a string

Write a C program to count total number of words in a string using loop. How to find total number of words in a given string using loops in C programming. Logic to count total number of words in a string.

Example

Input

Input string: I love Codeforwin.

Output

Total number of words: 4

Read more

C program to count frequency of each character in a string

Write a C program to count frequency of each character in a string using loop. How to find frequency of each characters in a string in C programming. Logic to count frequency of each character in a given string in C program.

Example

Input

Input string: Codeforwin

Output

Frequency of all characters in the given string:
'c' = 1
'd' = 1
'e' = 1
'f' = 1
'i' = 1
'n' = 1
'o' = 2
'r' = 1
'w' = 1

Read more