#include <stdio.h>
#include <string.h>
struct courses{
char coursenumber[10];
float credit;
float grade;
};
struct courses list[2];
main()
{
int i;
int count;
printf("Enter number of courses to input: ");
scanf("%d", &count);
for (i=0; i<2; i++)
{
printf("Course number: ");
scanf("%s", list[i].coursenumber );
printf("Credit: ");
scanf("%f", list[i].credit);
printf("Grade: ");
scanf("%f", list[i].grade);
}
printf("\n\n");
for (i=0; i<2; i++)
{
printf("%s", list[i].coursenumber);
printf("%f", list[i].credit);
printf("%f", list[i].grade);
}
return 0;
}
mona1nine 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.