please write that program with C language

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

please write that program with C language

The information of all students taking the programming course is kept in a random access file
with the struct given below. Your code should swap the information of two records in the file.
Write the code that performs this operation.
Note: The position of the 2 records that you need to swap like this:
The position of the first record is the sum of the first 5 digits of your student number.
The position of the second record is the sum of the last 5 digits of your student number.
Örnek (Examples):
if your student number is : 1910202034
: then you need to swap recods 13 <- ->9
if your student number is : 2014010217021 : then you need to swap recods
7<--> 11
Dosya (File):
struct student {
int number;
1.record
2.record
float midterm;
3.record
char name[40];
n.record
Transcribed Image Text:The information of all students taking the programming course is kept in a random access file with the struct given below. Your code should swap the information of two records in the file. Write the code that performs this operation. Note: The position of the 2 records that you need to swap like this: The position of the first record is the sum of the first 5 digits of your student number. The position of the second record is the sum of the last 5 digits of your student number. Örnek (Examples): if your student number is : 1910202034 : then you need to swap recods 13 <- ->9 if your student number is : 2014010217021 : then you need to swap recods 7<--> 11 Dosya (File): struct student { int number; 1.record 2.record float midterm; 3.record char name[40]; n.record
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT