#include <stdio.h>
int main()
{
int a = 5; // declare and initialize integer variable a to 5
float pi = 3.14; // Declare and initialize float variable pi to 3.14
char ch = 'A'; // variable ch is declared as Character variable and initialised to ‘A’
double dbl = 5.6789; // variable dbl is declared as double and initialised
// show the values of the variables
printf("\n Integer variable value:= %d", a);
printf("\n Float variable value:= %.2f ", pi);
printf("\n Character variable value:= %c ", ch);
printf("\n Double variable value:= %.4f ", dbl);
return 0;
}
Output:
Integer variable value:=5
Float variable value:=3.14
Character variable value:=A
Double variable value:=5.6789
1.Write a program in C to find area of circle using single-line comments.
2.Write a C program to find addition of two numbers with multi-line comments to write down the purpose of every steps.
3.Write a program in C that describe a complex mathematical formula with nested comments.
5.write a program code in c to swap a values of the two variable without using a third variable.
6.Write a program in c to find area of rectangle by accepting variable value length and width.
7.Write a program that accepts user input for employee name and salary, and then display them using those variables.
8.Write a program in C to demonstrate and decide the size of int, float, char, and double data types.
9.Write a program in C to convert temperature from Celsius to Fahrenheit using proper data types.
10.Write a C program to achieve basic arithmetic operations on any two numbers of various data types.
11.Write a program in C that accepts any two numbers from user and calculate addition, multiplication, subtraction and division (+, *,-, /) and show the result.
12.Write a program in c input user name, age And display it.
13.Write a program in C that asks the user to enter the marks obtained in three subjects. Read the marks using scan. Calculate the average marks and display the student details.
Previous Topic:-->>Dynamic memory FAQ. || Next topic:-->>Operators Assignments in C.