I was going to kill myself for this stupid mistake !

0 Death Note · May 26, 2015
#include <stdio.h>

#include <stdlib.h>

 

int  main()

{



    float grade = 0 ;

    float  scoredEnter = 0 ;

    float  numberoftest = 0 ;

    float average = 0 ;

 

    printf("press 0 when complete \n");

 

    do{

        printf("Number of Test:%.0f  Average:%.2f \n " , numberoftest , average);

        printf("\nEnter test Score: \n");

        scanf(" %f" , &scoredEnter);

        grade +=scoredEnter;

        numberoftest++;

        average = grade / numberoftest;

 

    }while{scoredEnter!=0};


 

    return 0;

}


Did u notice where is the mistake ? 

Post a Reply

Replies

Oldest  Newest  Rating
0 Savad Dekrup · May 27, 2015
intmain  
lel
the first freaking line.
+1 c student · May 27, 2015
floatscoredEnter= 0 ;

floatnumberoftest= 0 ;

your data types are not separated from your variable names.
while{scoredEnter!=0};

you've used curly braces where there are supposed to be parenthesis
0 Arun Sivanandan · May 27, 2015
Hey man, there should be spaces in between the datatype and the variable.
YOUR MISTAKE :
                                 floatscoredEnter= 0 ;
                                 floatnumberoftest= 0 ;

Spaces are required.
Also whenever you are using conditions or loop like if ,for,do,do..while use () . and not {}.
 
0 Death Note · May 27, 2015
You are right " c student " , I used curly braces by mistake 
  • 1

C

107,196 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator