0% found this document useful (0 votes)
27 views

Application Programs On Structures

The document shows a C program that uses a structure to store information about students including their name, roll number, age, and total marks. It defines a structure called Student with the data fields, creates an array of structures to hold data for 5 students, initializes the fields for each student, and prints out the student information at the end.

Uploaded by

sonikasharma.cse
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Application Programs On Structures

The document shows a C program that uses a structure to store information about students including their name, roll number, age, and total marks. It defines a structure called Student with the data fields, creates an array of structures to hold data for 5 students, initializes the fields for each student, and prints out the student information at the end.

Uploaded by

sonikasharma.cse
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Application programs on

structures
C Program to Store Information of Students Using Structure
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct Student { student[3].roll_number = 4;
char* name; student[3].name = "Geeks4";
int roll_number; student[3].age = 12;
int age; student[3].total_marks = 89.78;
double total_marks;
};
student[4].roll_number = 3;
int main()
student[4].name = "Geeks3";
{
student[4].age = 13;
int i = 0, n = 5;
student[4].total_marks = 78.55;
struct Student student[n];
student[0].roll_number = 1;
// Print the Students information
student[0].name = "Geeks1";
printf("Student Records:\n\n");
student[0].age = 12;
for (i = 0; i < n; i++)
student[0].total_marks = 78.50;
{
printf("\tName = %s\n", student[i].name);
student[1].roll_number = 5; printf("\tRoll Number = %d\n", student[i].roll_number);
student[1].name = "Geeks5"; printf("\tAge = %d\n", student[i].age);
student[1].age = 10; printf("\tTotal Marks = %0.2f\n\n",
student[1].total_marks = 56.84; student[i].total_marks);
}

student[2].roll_number = 2;
student[2].name = "Geeks2"; return 0;
student[2].age = 11; }
student[2].total_marks = 87.94;
output
Create a structure to specify data of customers in a bank. The data to be stored is: Account number,
Name, Balance in account. Assume maximum of 20 customers in the bank. Create a function to read all
customers details and call it in main. Your program must be menu driven with following options
1. Print the Account number and name and balance of each customer.
2. Withdraw money
3. Deposit money
4. Search Customer
Contd..
Contd..

You might also like