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.

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what do u mean by altkey?

1953


what is the difference between BI and pervasive BI?

5237


what is capital

2135


I didn't see any category for Project Management. What are the activities, documents; how to plan, schedule and monitor tasks, statuses, people...?

1709


a. Explain the three (3)  Facets of Supply Chain b. Explain the work of logistics c. Explain the three (3) description of customers d. Explain the importance of information technology in logistics

1806






i am going for the IT Officer written test,can any body mail me the question bank to Pragyanmund@rediffmail.com

1937


A network diagram for a hospital database. Consider your own set of processes for the hospital.

2912


Do you personally involved with Major incident process ? If yes, how do you manage it in your present organization ? explain with real scenario !

1298


From where I should start to prepare for cat?

1735


What is computer-based information system (CBIS) mean?

2207


Why are you interested in this position? Our company?

3754


When you are given to develop a computer based information system for banking, how do you write the SDLC diagram?. Explain the five phases with respect to banking.

2801


cost accounting is a tool for dicission making expline

1656


Hi, I worked TCS (BA) third party for only 18 days. After that i didnt go to office due to some problem. i send resign letter through mail.Just i want to know whether its affect my career.? also my consultant is drop the mail TCS is ben for me so its true ...i need to pull back agin try. so its posssible Pls guide me

1091


How to Cancel SAP PO against Fix transport?

1784