hrushij
Broken In
This code works fine on borlaand c++ 5.0 but it scans only first object in turbo c++ IDE
what is the problem with this..???
#include <stdio.h>
#include <conio.h>
struct student
{
char name[10];
int no;
float marks;
};
void main()
{
struct student s[5];
int i;
for(i=0;i<5;i++)
{
printf("Enter Name : ");
scanf("%s",s.name);
printf("Enter roll No. ");
scanf(" %d",&s.no);
printf("Enter Marks : ");
scanf(" %f",&s.marks);
}
getch();
}
thanks in advance..
what is the problem with this..???
#include <stdio.h>
#include <conio.h>
struct student
{
char name[10];
int no;
float marks;
};
void main()
{
struct student s[5];
int i;
for(i=0;i<5;i++)
{
printf("Enter Name : ");
scanf("%s",s.name);
printf("Enter roll No. ");
scanf(" %d",&s.no);
printf("Enter Marks : ");
scanf(" %f",&s.marks);
}
getch();
}
thanks in advance..