Mhs1.NilaiAkhir = 0.2*MhslkNilaiQuiz + 0.3*mhs1.NilaiUTS+ 0.5*mhs1.NilaiUAS Printf( “value UAS : “) scanf( “%d”, &mhs1.NilaiUAS) Printf( “Value UTS : “) scanf( “%d”, &mhs1.NilaiUTS) Printf( “value Quiz : “) scanf( “%d”, &MhslkNilaiQuiz) Printf( “Data that has been entered :\n”) Įxample 2, This is a more complex example. Printf( “Value : “) scanf( “%d”, &mhs1.Nilai) *an example of a simple program using a struct * / The following examples Using the Simple Program ‘struct’. Members of a structure can be either an array or structure in addition to the type of data primitive such as integer, long, float atau double. To declare a variable of type data_mahasiswa is as follows : Therefore it should be made a new data type that is suitable to the needs. Turbo C did not provide data types for data. The variables that make up a structure called the elements or members of structure.Ĭase in point is when you want to make a program in which the student data processing student data consists of NIM, Name and Value. Structure declared by reserved word struct. Structure is a grouping of the variables of different types in the same name.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |