Free Photos
WordPress Themes

mArray Simple[grades]

#include<stdio.h> #define NST 2 int fillArray(float grades[][3], char names[][20]) { int i, j; for (i = 0; i < NST; i++) { scanf("%s", names[i]); for (j = 0; j < 3; j++) { scanf("%f", &grades[i][j]); } } } int printArray(float grades[][3], char names[][20]) { int i, j; for (i = 0; i < NST; i++) { printf("%s\t", names[i]); for (j = 0; j < 3; j++) { printf("%f\t", grades[i][j]); } printf("\n"); } } int main() { int grades[NST][3]; char names[NST][20]; fillArray(grades, names); printArray(grades, names); system("PAUSE"); }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.