C - Write program to create multiple variables

Requirements

Create a program that uses the three integer variables i1, i2, and i3.

Assign integer values to each one, and display the result.

Hint

When declaring multiple variables of the same type, you can specify all of them on the same line.

int i1,i2,i3; 

Demo

#include <stdio.h> 

int main() //from  w  w  w.ja  v a 2 s.  co  m
{ 
      int i1, i2, i3; 

      i1 = 1; 
      i2 = 9; 
      i3 = 2; 
      printf("i1 is %d\ni2 is %d\ni3 is %d\n",i1,i2,i3); 
      return(0); 
}

Result

Related Exercise