proble with turbo c complier..!

Status
Not open for further replies.

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..
 

ayush_chh

Ambassador of Buzz
what do you mean that it scans only first object??? is it that it scans only for one time and exits...
 
Status
Not open for further replies.
Top