Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Name: <type your name, as shown on your student ID>
- Admin No:
- Class:
- */
- #include <stdio.h>
- extern float compMarks[ ] ; // declare as an external global variable
- void main(void)
- {
- //declare variables total (float), k (integer) & grade (character)
- float total;
- int k;
- char grade;
- total=0.0 ; //initialise total with zero
- //use for loop to display the data
- printf("The values in the data file are: \n");
- for ( k=0 ; k<7 ; k++ )
- {
- printf(" %.2f", compMarks[k]);
- }//for
- printf("\n\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement