Write a C Program to create a structured data file named
Student.dat to store the roll no, name
and course.
Provide following functions:
1. Accept the values from the user using structure
variables. Store the contents in a file.
2. Display the file.
3. The user should be able to add new records to the
existing file. And display the new file.
Answers were Sorted based on User's Feedback
Answer / muklesh kumr
#include <stdio.h>
#include <ctype.h>
struct Student
{
int ID;
char LastName[32];
char FirstName[32];
int DateOfBirth; // This could be of the form YYYYMMDD. For example someone born on December 21st, 1990 would have a value of 19901221
char Address[32];
char TelephoneNumber[11]; // a 10-digit string
char ProgramPursued[32];
};
char GetUserOption()
{
char option = 'I'; // 'I' for Invalid
while(option == 'I')
{
// Print the menu items
printf("\n");
printf("Choose one of the following options:\n[u]pdate [P]rint [S]earch [E]xit\n");
scanf("%c", &option);
switch(toupper(option))
{
case 'U':
case 'P':
case 'S':
case 'E':
break;
default:
option = 'I';
break;
}
}
return option;
}
// students must hold 10 students
void LoadStudents(Student students[])
{
// TODO: load students from file
}
// students must hold 10 students
void SaveStudents(Student students[])
{
// TODO: save students to file
}
int main()
{
Student students[10];
int looping = 1;
// Load the students from the file
LoadStudents(students);
// Loop until exit
while(looping)
{
char option = GetUserOption();
switch(option)
{
case 'U':
// TODO: Let the user update a record
break;
case 'P':
// TODO: Print the students to the screen
break;
case 'S':
// TODO: Let the user search for a student
break;
case 'E':
looping = 0; // exit the loop
break;
}
}
// Save the students to the file
SaveStudents(students);
return 0;
Is This Answer Correct ? | 73 Yes | 64 No |
Answer / madhuri
How tO store different students details using file. In c language. Can anybody help me?
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / ratnesh kumar
Write a C program that asks the user to enter a 10-digit.telephone number (the first three digits refer to the area code, the next three digits refer to the exchange code, and the remaining four digits refer to number), print the parts of the number and complete telephone number in additionto the area code and exchange code.
#include<stdio.h>
#include<conio.h>
main()
{
long int num,area_code,exchange_code,remaining_number,d,s;
printf("Enter the Number
");
scanf("%ld",&num);
area_code=num/10000000;
printf("The area code is%ld",area_code);
d=num/10000;
exchange_code=d%1000;
printf("
The exchange code is%ld",exchange_code);
remaining_number=num%10000;
printf("
remaining_number is%ld",remaining_number);
printf("
the sum of areacode and exchange code is:%ld",exchange_code+area_code);
getch();
}
Is This Answer Correct ? | 3 Yes | 2 No |
What type of questions will be asked in Bank of India Computer Officers (IT) exam? Will someone provide me the sample paper of Bank of India Computer Officer (IT) exam?
In the creation of the material master if user maintains MRP Type as ‘VB’ (Manual reorder point planning) unless until user will not maintain the Reorder point Qty & fixed lot size Qty system will not allow creating the material which is right process. Hence the same rule should be applied for MRP Type ‘ND’ also. So that user cannot fill the MRP Data unless he will not choose ‘VB’
What are the Roles and Responsibilities of BDM in IT Industry ? And Tell me some thing about about IT industries
state the role of cost accounting in large scale industry
sir iam going for an interview on feb 2nd week and i would like too ask questions that they will pose too me 1:i hav choosen conchordia wisconsin why these university what should b my answer 2:i had selected mis in mba from conchordioa university why these course if they question wat should b my answer 3:and last question is wat is guarantee u will come bck my dad works as a production manager in saudi arabia soo wat should b my anser too them because i am going for mba wat should b my answer for return gurantee pls reply too me it will b gr8 off u yours sicerly
Cisco vs HP vs IBM vs Dell
What are your strengths and talents?
What would your former boss/colleagues say about you?
Can you help me what kind of PM interview questions company can ask based on below job description?: *Work with business development, editorial, marketing and other departments as needed to understand and prioritize project requests. *Work with online creative, IT, and development departments to gather and disseminate project requirements. *Maintain weekly web projects production calendar *Assist in the quality assurance process associated with code releases to development, staging and production servers. *Participate in planning meetings for new site initiatives. Document, clarify and articulate requirements and bring thoughts to the discussion. *Distribute reports summarizing project milestones and associated tasks. *Create rough wireframes and functional diagrams for developers using Microsoft Visio. *Work with third party vendors to procure services associated with web development. *Work with our partners to ensure deliverables and associated tasks stay on track. Can you help me what kind of PM question company can ask based on above job description?
what are charateristics of business analsyt
Describe your ideal job and/or boss.
what is proxy?