Home Uncategorized C program to display multiple variables.

C program to display multiple variables.

SHARE


Write a C program to display multiple variables.

Solution:

#include <stdio.h>

void main()

{

   int a = 125, b = 30255;

   float x = 2.13459;

   double dx = 1.14155927;

   char c = ‘W’;

   printf(“a =  %d\n”, a);

   printf(“b = %d\n”, b);

   printf(“x = %f\n”, x);

   printf(“dx =  %lf\n”, dx);

   printf(“c = %c\n”, c);

}

Output:

a = 125

b = 30255

x = 2.134590

dx = 1.14155927

c = W

Back to Programs list.