UNIVERSITY: D4 ITB BATCH 6
EDUCATION MAJOR: TMD
This is a source code about a program which can be used to insert student's information. The user can insert ten students only. The information about the students such as Number, nim, name, and value. After user input information about the students already, the program will show ten record of the students.
Source code:
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int k;
struct data
{
int number;
char nim[20];
char name[20];
char value;
};
struct data st[10];
printf("Input students' information\n");
for (k=0;k<10;k++)
{
printf("Input Data %d \n",k+1);
printf("Number : ");
fflush(stdin);
scanf("%d", &st[k].number);
fflush(stdin);
printf("NIM : ");
scanf("%s", &st[k].nim);
fflush(stdin);
printf("Name : ");
scanf("%s", &st[k].name);
fflush(stdin);
printf("Value : ");
scanf("%c", &st[k].value);
}
for (k=0;k<10;k++)
{
printf("\nYour Data %d \n",k);
printf("Number : %d", st[k].number);
printf("\nNIM : %s", st[k].nim);
printf("\nName : %s", st[k].name);
printf("\nValue : %c", st[k].value);
}
system("pause");
return 0;
}
This is about the video or you can also see it at youtube.com by click this link below:
http://www.youtube.com/watch?v=EurlFTnlQ0A&feature=youtu.be
No comments:
Post a Comment