C program to convert temperature from degree celsius to fahrenheit

Write a C program to input temperature in Centigrade and convert to Fahrenheit. How to convert temperature from degree centigrade to degree Fahrenheit in C programming. Logic to convert temperature from Celsius to Fahrenheit in C.

Example
Input

Enter temperature in Celsius = 100

Output

Temperature in Fahrenheit = 212 F

Read more

C program to convert centimeter to meter and kilometer

Write a C program to input length in centimeter and convert it to meter and kilometer. How to convert length from centimeter to meter and kilometer in C programming. Length conversion program in C from centimeter to meter and centimeter to kilometer.

Example
Input

Enter length in centimeter = 1000

Output

Length in meter = 10 m
Length in kilometer = 0.01 km

Read more

C program to find diameter, circumference and area of circle

Write a C program to input radius of a circle from user and find diameter, circumference and area of the circle. How to calculate diameter, circumference and area of a circle whose radius is given by user in C programming. Logic to find diameter, circumference and area of a circle in C.

Example
Input

Enter radius: 10

Output

Diameter = 20 units
Circumference = 62.79 units
Area = 314 sq. units

Read more

C program to find area of a rectangle

Write a C program to input length and width of a rectangle and find area of the given rectangle. How to calculate area of a rectangle in C programming. Logic to find area of a rectangle whose length and width are given in C programming.

Example
Input

Enter length: 5
Enter width: 10

Output

Area of rectangle = 50 sq. units

Read more

C program to find perimeter of a rectangle

Write a C program to input length and width of a rectangle and calculate perimeter of the rectangle. How to find perimeter of a rectangle in C programming. Logic to find the perimeter of a rectangle if length and width are given in C programming.

Example
Input

Enter length: 5
Enter width: 10

Output

Perimeter of rectangle = 30 units

Read more

C program to perform all arithmetic operations

Write a C program to input two numbers and perform all arithmetic operations. How to perform all arithmetic operation between two numbers in C programming. C program to find sum, difference, product, quotient and modulus of two given numbers.

Example
Input

First number: 10
Second number: 5

Output

Sum = 15
Difference = 5
Product = 50
Quotient = 2
Modulus = 0

Read more

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

List of all format specifiers in C programming

In C programming we need lots of format specifier to work with various data types. Format specifiers defines the type of data to be printed on standard output. Whether to print formatted output or to take formatted input we need format specifiers. Format specifiers are also called as format string.

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