Wednesday, April 27, 2022

C program structure important question with its solution | Most repeated questions and important question of c program class 12 structure solutions

Write a program to enter the 20 employee’s name, age, and salary  using structure and print them (C program question class 12) .

Solutions :

#include<stdio.h>

struct emp

{

 char n[100];

int age;

int sal;

};

struct emp e[20];

int main()

{

int i;

printf("Enter employee name age and salary\n");

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

{

scanf("%s %d %d",e[i].n,&e[i].age,&e[i].sal);

}

printf("Name \t Age \t Salary\n");

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

{

printf("%s\t %d\t %d\t\n",e[i].n,e[i].age,e[i].sal);

}

return 0;

}

OUTPUT :

c program to enter age name and salary of employee by using structure of c program



For more details and query you can directly visit our youtube channel Tukus technology .


1 comment:

BCA ENTRANCE RESULT 2079 - CHECK YOUR BCA RESULT

 Hello everyone BCA Entrance result of TU ( 2079 ) is published . You can check your result by downloading pdf , so go on this video and dow...