Skip to content

Instantly share code, notes, and snippets.

@Rajssss
Created June 19, 2019 06:02
Show Gist options
  • Save Rajssss/d793b4fc40f975b5b90ea41365b9ebd8 to your computer and use it in GitHub Desktop.
Save Rajssss/d793b4fc40f975b5b90ea41365b9ebd8 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
typedef struct student
{
int roll;
float marks;
char Name[25];
char Gender;
}student;
int main()
{
int N, Flag=1;
printf("Enter number of students =>");
scanf("%d",&N);
student st[N];
do
{
printf("Enter details for student %d...\nEnter Roll NO. =>",Flag);
scanf("%d",&st[Flag].roll);
printf("Enter Marks =>");
scanf("%d",&st[Flag].marks);
getchar();
printf("Enter Name =>");
gets(st[Flag].Name);
printf("Enter Gender =>");
scanf("%c",&st[Flag].Gender);
Flag++;
}while(Flag<N);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment