adspace
how to write a program to accept names and marks of 10
students from the user and display the names and markes of
only the passed students. Marks greater than or equal to
35 is considered as pass.
Answer Posted / vignesh1988i
#include<stdio.h>
void main()
{
char names[10][20];
int a[10][2],n;
printf(":enter the number of students :");
scanf("%d",&n);
printf("enter the names and marks");
for(int i=0;i<n;i++)
{
scanf("%s",names[i]);
scanf('%d",&a[i]);
}
printf("the passed students are :\n");
for(int i=0;i<n;i++)
{
if(a[i]>=35)
{
printf("%s",names[i]);
}
}
getch();
}
| Is This Answer Correct ? | 6 Yes | 3 No |
Post New Answer View All Answers
No New Questions to Answer in this Category !! You can
Post New Questions
Answer Questions in Different Category