Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- struct student{
- char name[15];
- int rollno;
- };
- int main(){
- int size = 3;
- struct student s[size];
- int counter;
- for (counter = 0; counter < size; counter++){
- printf("Enter the name of student %d\n", counter+1);
- scanf("%s",s[counter].name);
- printf("Enter the ID number of student %d\n", counter+1);
- scanf("%d",&s[counter].rollno);
- }
- for (counter = 0; counter < size; counter++){
- printf("Name: %s\tID Number: %d\n", s[counter].name,s[counter].rollno);
- }
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement