OLD IS GOLD COMPUTER PROGRAMMING IN C GRADE XII- 2076|QN 4

OLD IS GOLD COMPUTER PROGRAMMING IN C GRADE XII- 2076|QN 4

 What is structure? Write a C program to input employee id, name, address and post of 20 employees and display them properly.

For information about structure

Click here

Write a C program to input employee id, name, address and post of 20 employees and display them properly.

#include<stdio.h>

#include<conio.h>

void main()

{

struct record

{

int id;

char name[30], add[20];

    };

    struct record a[20];

    int i;

printf("\n Enter Employee id, Name and Address of 20 employee");

for(i=0;i<20;i++)

{

scanf("%d%s%s", &a[i].id, a[i].name, a[i].add);

}

for(i=0;i<20;i++)

{

printf("\n Employee id=%d\t Name=%s\t Address=%s", a[i].id, a[i].name, a[i].add);

}

getch();

}

Output



Post a Comment

0 Comments