In: Computer Science
#include<stdio.h>
#include<stdlib.h>
int main()
{
//VARIABLE DECLARATIONS
char names[1000][30],temp[30];
int userID[1000],mark[1000];
int i,n;
//ASK USER FOR NUMBER OF STUDENTS TO INPUT
printf("\n Enter the number of students want to
enter");
gets(temp); //read the nu,mber using gets()
n=atoi(temp); //assign it to n by using atoi(), which
converts string to integer
//loop to read n number of students
for(i=0;i<n;i++)
{
printf("\n Enter the name of
student %d:",i+1);
gets(names[i]); //read the
name
printf("\n Enter ID for student
%d:",i+1);
gets(temp); //read the student
is
userID[i]=atoi(temp); //convert to
integer using atoi()
printf("\n Enter mark for student
%d:",i+1);
gets(temp);//read the mark
mark[i]=atoi(temp); //convert to
integer wsing atoi()
}
printf("\n NAME\t\tUSERID\tMARKS");
//display the details
for(i=0;i<n;i++)
printf("\n%s\t%d\t%d",names[i],userID[i],mark[i]);
}
OUTPUT