Question

Write a C program to store the first name, the age and the exam mark of...

Write a C program to store the first name, the age and the exam mark of 5 students by using an array of structures. Print the information stored in the structure array on the screen

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code :int age; 9 #include <stdio.h> 10 struct students{ 11 char f_name[20]; 12 13 int marks; 14 }; 15 16 int main() 17 - { 18 struc

Output :

main.c:23:17: warning: format %s expects argumen- Enter first name : lav Enter age : 23 Enter marks : 88 Enter first name :

Add a comment
Know the answer?
Add Answer to:
Write a C program to store the first name, the age and the exam mark of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Pointer tasks: ( In C++ ) 1. Write a program to store the address of a...

    Pointer tasks: ( In C++ ) 1. Write a program to store the address of a character variable and a float variable. • Print the address of both variables. • Print the values of variable using dereference operator. • Add 2 in float value using pointer. • Print address of character variable using reference operator. 2. Write a program that takes 5 elements in an array and print them in reverse order using pointers. 3. Write to program that takes...

  • ASSIGNMENT: Student Data Write a program that uses two structures Name and Student to store the following information for multiple students 1. Create a NAME structure that consists of o First Name, M...

    ASSIGNMENT: Student Data Write a program that uses two structures Name and Student to store the following information for multiple students 1. Create a NAME structure that consists of o First Name, Middle Initial, and oLast Name. 2. Create a STUDENT structure that contains student information (Include the NAME structure within the Student information structure): o Name o email o Program (an enum type containing programs such as CSCI, DBMS, INFM, SDEV) ASSIGNMENT: Student Data Write a program that uses...

  • Write a program (C++) that shows Game sales. The program should use a structure to store...

    Write a program (C++) that shows Game sales. The program should use a structure to store the following data about the Game sale: Game company Type of Game (Action, Adventure, Sports etc.) Year of Sale Sale Price The program should use an array of at least 3 structures (3 variables of the same structure). It should let the user enter data into the array, change the contents of any element and display the data stored in the array. The program...

  • Structures in C++ :- 2. Write a program that declares a structure to store the distance...

    Structures in C++ :- 2. Write a program that declares a structure to store the distance covered by player along with the time taken to cover the distance. The program should input the records of two players and then display the record of the winner. 3. Write a program that declares a structure to store income, tax rate and tax of a person. The program defines an array of structure to store the records of five person. It inputs income...

  • Structures in C++ :- 1. Write a program that declares a structure to store the code...

    Structures in C++ :- 1. Write a program that declares a structure to store the code number, salary and grade of an employee. The program defines two structure variables, inputs record of two employees and then displays the record of the employee with more salary. 2. Write a program that declares a structure to store the distance covered by player along with the time taken to cover the distance. The program should input the records of two players and then...

  • Write this in a C program please. Structures on Disk The Problem Your task is to...

    Write this in a C program please. Structures on Disk The Problem Your task is to write a program that stores and retrieves structures in a file on disk. The file of structures must remain on the disk once your program ends. You should be able to store structures to the file and retrieve from the file after restarting the program. The record that you will be writing to file has the following structure: struct contact {unsigned long phone_number; long...

  • Write a c++ program which uses a structure having the indicated member names to store the...

    Write a c++ program which uses a structure having the indicated member names to store the following data: Name (student name) IDnum (student ID number) Tests (an array of three test scores) Average (average test score) Grade (course grade) The program will keep a list of three test scores for one student. The program may prompt the user for the name, ID number, and test scores, or these may be assigned within the program. The average test score will be...

  • SC 111 - BMCC Exam Student Name: Type # 4 - 20 Points write a program...

    SC 111 - BMCC Exam Student Name: Type # 4 - 20 Points write a program that uses a structure named Student to store the following information about a Student: Name ID GPA Address The program should create three Student instances, store values, and pass all of them to a function that displays the information about the Student in a clearly formatted manner. The program also uses another function to calculate and display the average GPA of all three Students.

  • (Write a program, and show the output too) C programming I have a hard time to...

    (Write a program, and show the output too) C programming I have a hard time to get these five questions done. I am thankful if someone can help me with that. I started with something but i couldn't get it done. That's what I've done. #include <stdio.h> typedef struct _profile {    char name[32];    int age; } Profile; Profile prof[3] = {"myName", 19}, {"bob", 12} arr[1] = prof; for (int i = 0; i < 3; i++) {   ...

  • Write a program and flowchart. The program should store the ages of six of your friends...

    Write a program and flowchart. The program should store the ages of six of your friends in an array. Store each of the six ages using the assignment operator. Print the ages on-screen using a "for" loop.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT