/*Program to accept name , class and marks of 10 students with the use of structure with array of pointer and also print them.*/ #include main ( ) { struct { char name[20]; int class; int marks; }*rec[10]; int i; for ( i=0;i< 10;i++ ) { printf ( "Name:" ); scanf ( " %s", rec[i]->name ); printf ( "Class:" ); scanf ( " %d", &rec[i]->class ); printf ( " Marks:" ); scanf ( " %d", &rec[i]->marks ); } printf ( "Name\tClass\tMarks\n" ); for ( i=0 ; i<10 ;i++ ) { printf ( " %s\t" , rec[i]->name ); printf (" %d\t" , rec[i]->class ); printf ( " %d\n" , rec[i]->marks ); } }
|
| Author: Avdhut Sonpethkar 26 May 2008 | Member Level: Gold Points : 2 |
hey cool infor that means we can post program too
|
| Author: Ebrahim 26 May 2008 | Member Level: Silver Points : 2 |
Good logic.
|
| Author: Vidya 26 May 2008 | Member Level: Diamond Points : 2 |
simple and nice c pgm
|