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 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what four attribut in business case?

2126


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’

2979


How we do trimming in Solaris and how to prevent the /var from become disk full.

1669


what do you mean by "Closures with help of Top Management and Colleagues"

2160


I have given ielts exam and i got 5.5 bands and i also got three I-20s from the US universities, so my ielts score will interrupt my visa or not? I want to confirm it.

1998






Why general ledger accounts require "post automatically" setting in SAP??

1670


expline the relevance of economic meltdown and the cost accounting

1863


what is erp manufacturing perspective??

4065


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?

2266


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

1984


what is the difference between BI and BW security?

2157


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?

2172


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.

2934


what is capital

2268


could you provide me the information regarding UNIVESAL WORK LIST(UWL)?this question is regarding SAP EP.

2567