defining structure variable in different way

  /*structure is used to store differt types of parameter in a single system


of fuction


sumit.name is used to point out value at name in parameter sumit*/




#include <stdio.h>




int main(){


struct student {

char name[70];

int age ;

int rollno;


} sumit = { "sumitbohare" , 18, 34},

Rohit = {"Rohitparmar", 20 , 31},

Aditya= {"AdityaMalviya" , 19, 10};



 printf("%s, %d, %d \n", sumit.name , sumit.age , sumit.rollno );

 printf("%s, %d, %d\n ", Rohit.name , Rohit.age , Rohit.rollno );

 printf("%s, %d, %d ", Aditya.name , Aditya.age , Aditya.rollno );

 return 0;


}


Comments

Popular posts from this blog

Factors : using C

Cross shaped pattern

Factorial ! calculation