+ 2
How to structure use of programming coding
4 Answers
+ 3
Structure is used to store data of different datatypes whereas arrays are used to store data of similar datatypes.
Ex:
struct {
Int,
Char,
Long,
double
};
Structures are most useful with different data structures.
+ 2
Could you please clarify your question?
+ 1
Your answer is good
+ 1
Example like
To store student details of different data types
Struct Student {
int rno;
Char name[10];
Char last_name[20];
Float percentage;
};
Void main()
{
Scanf(%d,%c,%c,%f,&rno,&name,&last_name,&percentage);
Printf("roll no:%d,name:%c,last_name:%c,percentage:%f",rno,name,last_name,percentage);
}