Declare a structure type Element to represent one element from the periodic tabl
ID: 3615603 • Letter: D
Question
Declare a structure type Element to represent one element from the periodic table of elements. Components are to include: the atomic number (as an int), the name (as a string), and a seven-element array of integers for the number of electrons in each shell. The following are the components of an Element structure for sodium: 11 Sodium 2 8 1 0 0 0 0 Write a function called scanElement () which gets values for an Element variable from the user. The prototype is: void scanElement (Element* element);Explanation / Answer
please rate - thanks #include #include #include struct Element { int number; char name[15]; int electrons[7]; }element; void scanElement(Element*); int main() {int i; scanElement(&element); printf("Element name: %s ",element.name); printf("Atomic number: %d ",element.number); printf("Electrons in each shell:"); for(i=0;iname); printf("Enter atomic number: "); scanf("%d",&element->number); printf("Enter Electrons in each shell: "); for(i=0;ielectrons[i]); } }Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.