This is one of my home work .But I have a problem is I don't know why %c can't with while,for or do while loops please help me
and please help me write this program by for loopsCode:#include<stdio.h>
#include<conio.h>
main(){
int ids,no,x ;
char nam ;
float gpa ;
printf("------------------------------------------------\n");
printf(" Program Study Result\n ");
printf("------------------------------------------------\n");
printf("Enter number of student : ");
scanf("%d",&no);
printf("\n------------------------------------------------");
x = 1;
while (x<=no) {
printf("\nStudent No.%d",x );
printf("\nEnter student id : ");
scanf("%d",&ids);
printf("Enter student name : ");
gets(nam);
printf("\nEnter student GPA : ");
scanf("%f",&gpa);
if (gpa>=2.00){
printf("\nStudy result is : PASS "); }
else
printf("\nStudy result is : NOT PASS ");
x++;
}
printf("\n------------------------------------------------\n");
getch();
}
_____X
___XXX
XXXXXX
___XXX
_____X
Thank you very much for help...
I,m thai, I know english a little bit .
I'm sorry, if some word I type you don't know.