Guest User

Untitled

a guest
Jul 5th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.63 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main() {
  5.     struct numOfColleges {
  6.         char name[32];
  7.         int numOfStudents;
  8.         int numOfCafedras;
  9.         int numOfFacultets;
  10.     };
  11.     struct numOfColleges nn[4];
  12.     int i = 0;
  13.     char c;
  14.     char tmp_name[32];
  15.     for(i;i<4;i++) {
  16.         printf("enter name of college: ");
  17.         gets(nn[i].name);
  18.         printf("enter number of students: ");
  19.         gets(tmp_name);
  20.         nn[i].numOfStudents = atoi(tmp_name);
  21.         printf("enter number of cafedras: ");
  22.         gets(tmp_name);
  23.         nn[i].numOfCafedras = atoi(tmp_name);
  24.         printf("enter number of facultets: ");
  25.         gets(tmp_name);
  26.         nn[i].numOfFacultets = atoi(tmp_name);
  27.     }
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment