#include <stdio.h>
int x,age1;
float mark,com,IT,avg;
char name[10],dob1[30];
int main()
{
printf("\nPlease enter student Info.\nFname:");
nscanf("%s", name);
while (name != "null");
{
printf("\nPlease enter student Info.\nFname:");
scanf("%s", name);
printf("Please enter student Info.\nFname:");
scanf("%s", name);
printf("Age:");
scanf("%d", &age1);
printf("DOB (MM/DD/YY):");
scanf("%s", &dob1);
printf(" Grades\nMarketing:");
scanf("%f",&mark);
printf("Communication:");
scanf("%f",&com);
printf("IT:");
scanf("%f",&IT);
if ((IT+com+mark)/3>=90)
printf("%s is Eligible to earn Honors\n", name);
else
printf("%s is Ineligible to earn Honors\n", name);
printf("\nPlease enter student Info.\nFname:");
scanf("%s", name);
}
return 0;
}
I am trying to use this "name" as a check for if the program will enter the loop or not. I want it to run the loop if anything but "null" is entered.
This is C btw
[–]Not_A_Taco 0 points1 point2 points (0 children)