All articles
c

A program to print declare variables

Share this article

Share on LinkedIn Share on X (formerly Twitter)

C Programming Language 002

The following code shows how to write a program to print declare variables for integer, floating point and character datatype.

Program

#include <stdio.h>
 
void main()
{
    int a = 2;
    float b = .4;
    char c = 'v';
    printf("%d \n %f \n %c \n", a, b, c);
}

Result

2
 0.400000
 v

Comments