STRUCTURE USING FUNCTION

#include<stdio.h>
#include<conio.h>
void input();
void output();
struct stud
{
  int rno;
  char name[10];
};
//sobj is object name
struct stud sobj;

void main()
{
 clrscr();
 input();
 output();
 getch();
}

void input()
{
 printf("\nEnter RollNo : ");
 scanf("%d",&sobj.rno);

 printf("\nEnter Name : ");
 scanf("%s",&sobj.name);
}

void output()
{
 printf("\nRoll No : %d",sobj.rno);
 printf("\nName : %s",sobj.name);

}
Output

No comments:

Post a Comment

Programmingway@Eklavya Technosys!: JTET 2026 | Computer Sections Solutions | Paper -II

Programmingway@Eklavya Technosys!: JTET 2026 | Computer Sections Solutions | Paper -II :   1) Which of the following is the extension of Not...