Program of Telephone Directory That Provides Append, Find and Display All Records From a File - C...

download Program of Telephone Directory That Provides Append, Find and Display All Records From a File - C Programming Examples and Tutorials

of 4

Transcript of Program of Telephone Directory That Provides Append, Find and Display All Records From a File - C...

  • 7/29/2019 Program of Telephone Directory That Provides Append, Find and Display All Records From a File - C Programming Examples and Tutorials

    1/4

    9/20/13 Program of telephone directory that provides append, find and display all records from a file - C Programming Examples and Tutorials

    www.dailyfreecode.com/Code/telephone-directory-provides-append-617.aspx 1/4

    HOME ARTICLES FORUM INTERVIEW FAQ ACTIVITIES NEWS VIDEOS POLL LINKS PEOPLE GROUPS

    C Programming Articles Submit Article

    Home Articles C Programming BIOS Programming RSS Feeds

    Program of telephone directory that

    provides append, find and display all

    records from a filePosted By: Easy Tutor Category: C Programming Views:4508

    Write a program of telephone directory that provides below facility usingfile.

    1) Add and Append records2) Search / Find3) Display all records

    Download Sourcecode for Program of telephone directory that provides append, find

    and display all records from a file (Size: .81 KB)

    Code for Program of telephone directory that provides append, find and display all

    records from a file in C Programming

    #include

    #include

    #include

    struct person{

    char name[20];

    long telno;

    };

    void appendData(){

    FILE *fp;

    struct person obj;

    clrscr();

    fp=fopen("data.txt","a");

    printf("*****Add Record****\n");

    C Programming

    View All

    Homework Help

    Data File Structure

    Projects

    Beginners

    BIOS Programming

    TSR Programming Interrupt Programming

    Mouse Programming

    Keyboard Programming

    Parallel Port Programm...

    Parallel Processing Pr...

    Computer Graphics Mathematics Program

    Numerical Methods

    Interview FAQ

    Assembly Language

    Artificial Intelligence

    C++ Programming

    Visual C++

    OOAD

    Cobol

    Java

    SQL Server

    Asp.net MVC

    Rest and WCF Services

    Entity Framework

    Knockout.Js

    Unix / Linux / Ubuntu

    Networking

    OOPs Concept

    HTML

    Dos

    SQL

    System Analysis & Design

    Gadgets

    Internet

    CSS

    Javascript

    .Net Framework

    Asp.net

    C#

    VB.Net

    Python

    Welcome - Guest! Login / Register Now |

    Search: Search

    DailyFreeCode

    Like 1,907

    http://www.dailyfreecode.com/Tutorial/Easy-Javascript-17.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Visual_C-62.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Visual_C-62.aspxhttp://www.facebook.com/DailyFreeCodehttp://www.facebook.com/DailyFreeCodehttp://twitter.com/dailyfreecodehttp://www.facebook.com/DailyFreeCodehttp://www.dailyfreecode.com/CreateUser.aspxhttp://www.dailyfreecode.com/UserLogin.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Python-63.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-VB_Net-5.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-C_Sharp-4.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Aspnet-7.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Net_Framework-37.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Javascript-17.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-CSS-10.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Internet-57.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Gadgets-56.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-System_Analysis__Design-55.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-SQL-52.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Dos-51.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-HTML-11.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-OOPs_Concept-21.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Networking-29.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Unix__Linux__Ubuntu-40.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-KnockoutJs-61.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Entity_Framework-58.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Rest_and_WCF_Services-60.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Aspnet_MVC-59.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-SQL_Server-12.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Java-14.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Cobol-50.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-OOAD-54.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Visual_C-62.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-CPP-16.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Artificial_Intelligence-53.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Assembly_Language-49.aspxhttp://www.dailyfreecode.com/Tutorial_Simple_C_Programming-15/Interview-FAQ-201.aspxhttp://www.dailyfreecode.com/Tutorial_Simple_C_Programming-15/Numerical-Methods-265.aspxhttp://www.dailyfreecode.com/Tutorial_Simple_C_Programming-15/Mathematics-Program-257.aspxhttp://www.dailyfreecode.com/Tutorial_Simple_C_Programming-15/Computer-Graphics-245.aspxhttp://www.dailyfreecode.com/Tutorial_Simple_C_Programming-15/Parallel-Processing-Programs-230.aspxhttp://www.dailyfreecode.com/Tutorial_Simple_C_Programming-15/Parallel-Port-Programming-229.aspxhttp://www.dailyfreecode.com/Tutorial_Simple_C_Programming-15/Keyboard-Programming-228.aspxhttp://www.dailyfreecode.com/Tutorial_Simple_C_Programming-15/Mouse-Programming-227.aspxhttp://www.dailyfreecode.com/Tutorial_Simple_C_Programming-15/Interrupt-Programming-226.aspxhttp://www.dailyfreecode.com/Tutorial_Simple_C_Programming-15/TSR-Programming-225.aspxhttp://www.dailyfreecode.com/Tutorial_Simple_C_Programming-15/BIOS-Programming-224.aspxhttp://www.dailyfreecode.com/Tutorial_Simple_C_Programming-15/Beginners-218.aspxhttp://www.dailyfreecode.com/Tutorial_Simple_C_Programming-15/Projects-217.aspxhttp://www.dailyfreecode.com/Tutorial_Simple_C_Programming-15/Data-File-Structure-213.aspxhttp://www.dailyfreecode.com/Tutorial_Simple_C_Programming-15/Homework-Help-212.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-C_Programming-15.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-C_Programming-15.aspxhttp://www.dailyfreecode.com/UserLogin.aspx?qsRefCode=DownloadArticlehttp://www.dailyfreecode.com/Tutorial/Easy-C_Programming-15.aspxhttp://www.dailyfreecode.com/User/easy-tutor-243.aspxhttp://feeds.feedburner.com/syntaxexamplearticlesRssFeedhttp://www.dailyfreecode.com/Tutorial_Simple_C_Programming-15/BIOS-Programming-224.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-C_Programming-15.aspxhttp://www.dailyfreecode.com/Article.aspxhttp://www.dailyfreecode.com/Default.aspxhttp://www.dailyfreecode.com/MyWork/ArticleModeSelection.aspxhttp://www.dailyfreecode.com/Community.aspxhttp://www.dailyfreecode.com/MembersPicView.aspxhttp://www.dailyfreecode.com/HotLinks.aspxhttp://www.dailyfreecode.com/Poll.aspxhttp://www.dailyfreecode.com/Videos.aspxhttp://www.dailyfreecode.com/News.aspxhttp://www.dailyfreecode.com/Activitylog/ShowAll.aspxhttp://www.dailyfreecode.com/Interview.aspxhttp://www.dailyfreecode.com/Message-Board/Forum.aspxhttp://www.dailyfreecode.com/Article.aspxhttp://www.dailyfreecode.com/Default.aspx
  • 7/29/2019 Program of Telephone Directory That Provides Append, Find and Display All Records From a File - C Programming Examples and Tutorials

    2/4

    9/20/13 Program of telephone directory that provides append, find and display all records from a file - C Programming Examples and Tutorials

    www.dailyfreecode.com/Code/telephone-directory-provides-append-617.aspx 2/4

    Previous Post:

    Program to sort numbers in ascending

    order and use integer pointer to store

    Next Post:

    Program to concatenate two strings

    printf("Enter Name : ");

    scanf("%s",obj.name);

    printf("Enter Telephone No. : ");

    scanf("%ld",&obj.telno);

    fprintf(fp,"%20s %7ld",obj.name,obj.telno);

    fclose(fp);

    }

    void showAllData(){

    FILE *fp;

    struct person obj;

    clrscr();

    fp=fopen("data.txt","r");

    printf("*****Display All Records*****\n");

    printf("\n\n\t\tName\t\t\tTelephone No.");

    printf("\n\t\t=====\t\t\t===============\n\n");

    while(!feof(fp))

    {

    fscanf(fp,"%20s %7ld",obj.name,&obj.telno);

    printf("%20s %30ld\n",obj.name,obj.telno);

    }

    fclose(fp);

    getch();

    }

    void findData(){

    FILE *fp;

    struct person obj;

    char name[20];

    int totrec=0;

    clrscr();

    fp=fopen("data.txt","r");printf("*****Display Specific Records*****\n");

    printf("\nEnter Name : ");

    scanf("%s",&name);

    while(!feof(fp))

    {

    fscanf(fp,"%20s %7ld",obj.name,&obj.telno);

    if(strcmpi(obj.name,name)==0){

    printf("\n\nName : %s",obj.name);

    printf("\nTelephone No : %ld",obj.telno);

    totrec++;

    }

    }

    if(totrec==0)

    printf("\n\n\nNo Data Found");

    else

    printf("\n\n===Total %d Record found===",totrec);

    fclose(fp);

    getch();}

    void main(){

    char choice;

    while(1){

    clrscr();

    printf("*****TELEPHONE DIRECTORY*****\n\n");

    printf("1) Append Record\n");

    printf("2) Find Record\n");

    printf("3) Read all record\n");

    printf("4) exit\n");

    printf("Enter your choice : ");

    fflush(stdin);

    choice = getche();

    switch(choice){

    case'1' : //call append record

    appendData();

    break;

    case'2' : //call find record

    findData();

    break;

    case'3' : //Read all record

    showAllData();

    break;

    case'4' :

    case 27 : exit(1);

    }

    }

    }

    Share:

    Perl

    Oracle

    Software Engineering

    RDBMS Terms

    AJAX Framework

    Design Pattern

    UML

    WPF

    WCF

    SEO

    PowerShell

    Visual Studio

    WWF

    BizTalk Server

    Azure

    General

    Testing

    Online Certifications

    PHP

    My SQL

    LinQ

    Project Management

    Silverlight

    XML

    MS Office

    Windows OS

    DHTML

    Sharepoint

    Like 0 015 0 1293

    http://www.dailyfreecode.com/Code/sort-numbers-ascending-order-integer-616.aspxhttp://www.go4sharepoint.com/http://www.dailyfreecode.com/Tutorial/Easy-DHTML-31.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Windows_OS-33.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-MS_Office-32.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-XML-25.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Silverlight-23.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Project_Management-22.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-LinQ-6.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-My_SQL-36.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-PHP-35.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Online_Certifications-30.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Testing-20.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-General-47.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Azure-46.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-BizTalk_Server-45.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-WWF-43.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Visual_Studio-44.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-PowerShell-48.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-SEO-65.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-WCF-42.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-WPF-41.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-UML-39.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Design_Pattern-38.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-AJAX_Framework-9.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-RDBMS_Terms-18.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Software_Engineering-19.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Oracle-13.aspxhttp://www.dailyfreecode.com/Tutorial/Easy-Perl-64.aspxhttp://www.dailyfreecode.com/Code/concatenate-two-strings-618.aspxhttp://www.dailyfreecode.com/Code/sort-numbers-ascending-order-integer-616.aspxhttp://www.dailyfreecode.com/Code/sort-numbers-ascending-order-integer-616.aspx
  • 7/29/2019 Program of Telephone Directory That Provides Append, Find and Display All Records From a File - C Programming Examples and Tutorials

    3/4

    9/20/13 Program of telephone directory that provides append, find and display all records from a file - C Programming Examples and Tutorials

    www.dailyfreecode.com/Code/telephone-directory-provides-append-617.aspx 3/4

    numbers

    Easy Tutor author of Program of telephone directory that providesappend, find and display all records from a file is from United States.Easy Tutor says

    Hello Friends,

    I am Free Lance Tutor, who helped student in completing theirhomework.

    I have 4 Years of hands on experience on helping student incompleting their homework. I also guide them in doing their final yearprojects.

    I have share many programs on this website for everyone to usefreely, if you need further assistance, than please contact meon easytutor.2ya [at the rate] gmail [dot] com

    I have special discount scheme for providing tutor services. I amproviding tutor service to students from various contries, currentlymost of my students are from United States, India, Australia,Pakistan, Germany, UK and Canada.

    I am also here to expand my technical network to receive moreopportunity in my career, make friends to help them in resolving their

    technical problem, learn and share my knowledge, If you like to bemy friend, Please send me friend request.

    Thanks,Happy Programming :)

    View All Articles

    Didn't find what you were looking for? Find more on Program of telephone directory

    that provides append, find and display all records from a file Or get search suggestionand latest updates.

    Related Articles and Code:

    Program to add record in a file, search record by name telephone number and

    display all records from a file

    Electronic Telephone Directory - File Handling and Graphics

    Program to display bill receipt based on customer information and createtelephone directory

    Script to make File and Directory Management Operations menu based : Display

    Current directory, List Directory, Make Directory, Change Directory etc

    Program that maintains telephone directory

    Menu driven telephone directory program

    Program of telephone directory

    Program to writes the records reside in the input file and displays on the screen

    PROGRAM TO CREATE THE RELATIVE FILE AND ADD RECORD,UPDETE

    RECORD,DELETE PERTICULAR RECORD AND READ THE SPCIFY RECORD

    Shell script to perform operations like display, list, make directory and copy,

    rename, delete, edit fileFile handling program to display directory contents

    APPENDING ITEMS TO AN EXISTING FILE USING DO WHILE LOOP

    Program to perform array operations like append, insert, delete, edit, display

    and search and element

    Program of circular doubly link list with insert, append, delete, copy, reverse

    and display operations

    Program to Accept The Records of Employee and Store the contents in one file

    and store the records of a particular field in another filePerform directory operations like display current , list, Make, Change directory

    and file operations like Copy, Rename, Delete, Edit based on menu

    PROGRAM FOR INPUT RECORDS INTO THE FILE USING EXTEND MODEPROGRAM TO SEARCH THE RECORDS FROM FILE

    PROGRAM TO SORT THE RECORDS OF FILE

    PROGRAM TO SORT THE RECORDS OF FILE

    Other Interesting Articles in C Programming:

    Program to do sum of numbers from 1 to 10, by dividing the job into twoprocesses using Shared Memory

    Use of structure pointers as function parameters

    Sort given string in ascending order

    Program to print multiple of 5

    Program of ADAMS-MOULTON METHODGUASS JORDEN ELIMINATION METHOD

    Program to read the following numbers,round them off to the nearest integers

    and print out the results in integer form: 35.7 50.21 -23.73 -46.45

    Program to make Ctrl and Alt Key Pressed on a Key Press from Keyboard

    String handling by pointers

    Program to display triangleProgram to print multiplication table using two-dimensional array

    http://www.dailyfreecode.com/Code/sort-numbers-ascending-order-integer-616.aspxhttp://www.dailyfreecode.com/Code/print-multiplication-table-two-2592.aspxhttp://www.dailyfreecode.com/Code/display-triangle-605.aspxhttp://www.dailyfreecode.com/Code/string-handling-pointers-2618.aspxhttp://www.dailyfreecode.com/Code/ctrl-alt-key-pressed-key-press-keyboard-957.aspxhttp://www.dailyfreecode.com/Code/read-following-numbersround-them-1477.aspxhttp://www.dailyfreecode.com/Code/guass-jorden-elimination-method-2373.aspxhttp://www.dailyfreecode.com/Code/adams-moulton-method-2358.aspxhttp://www.dailyfreecode.com/Code/print-multiple-5-1435.aspxhttp://www.dailyfreecode.com/Code/sort-given-string-ascending-order-2751.aspxhttp://www.dailyfreecode.com/Code/structure-pointers-function-parameters-2550.aspxhttp://www.dailyfreecode.com/Code/sum-numbers-1-10-dividing-job-two-2137.aspxhttp://www.dailyfreecode.com/Code/sort-records-file-1886.aspxhttp://www.dailyfreecode.com/Code/sort-records-file-1885.aspxhttp://www.dailyfreecode.com/Code/search-records-file-1884.aspxhttp://www.dailyfreecode.com/Code/input-records-file-extend-mode-1883.aspxhttp://www.dailyfreecode.com/Code/perform-directory-operations-display-2737.aspxhttp://www.dailyfreecode.com/Code/accept-records-employee-store-contents-1961.aspxhttp://www.dailyfreecode.com/Code/circular-doubly-link-list-insert-2648.aspxhttp://www.dailyfreecode.com/Code/perform-array-operations-append-2646.aspxhttp://www.dailyfreecode.com/Code/appending-items-existing-file-while-2627.aspxhttp://www.dailyfreecode.com/Code/file-handling-display-directory-1200.aspxhttp://www.dailyfreecode.com/Code/shell-script-perform-operations-1659.aspxhttp://www.dailyfreecode.com/Code/create-relative-file-recordupdete-1892.aspxhttp://www.dailyfreecode.com/Code/writes-records-reside-input-file-1843.aspxhttp://www.dailyfreecode.com/Code/telephone-directory-456.aspxhttp://www.dailyfreecode.com/Code/menu-driven-telephone-directory-160.aspxhttp://www.dailyfreecode.com/Code/maintains-telephone-directory-1149.aspxhttp://www.dailyfreecode.com/Code/script-file-directory-management-1603.aspxhttp://www.dailyfreecode.com/Code/display-bill-receipt-based-customer-1150.aspxhttp://www.dailyfreecode.com/Code/electronic-telephone-directory-file-1022.aspxhttp://www.dailyfreecode.com/Code/record-file-search-record-name-2218.aspxhttp://www.dailyfreecode.com/User/easy-tutor-243.aspxhttp://www.dailyfreecode.com/Updates.aspx?q=Program+of+telephone+directory+that+provides+append,+find+and+display+all+records+from+a+filehttp://www.dailyfreecode.com/MySearchResult.aspx?q=program+telephone+directory+append+find+display+records+file&stype=allhttp://www.dailyfreecode.com/ShowAllArticles/Programmer243.aspxhttp://www.dailyfreecode.com/Country/United-States.aspxhttp://www.dailyfreecode.com/User/easy-tutor-243.aspxhttp://www.dailyfreecode.com/Code/sort-numbers-ascending-order-integer-616.aspx
  • 7/29/2019 Program of Telephone Directory That Provides Append, Find and Display All Records From a File - C Programming Examples and Tutorials

    4/4

    9/20/13 Program of telephone directory that provides append, find and display all records from a file - C Programming Examples and Tutorials

    www.dailyfreecode.com/Code/telephone-directory-provides-append-617.aspx 4/4

    Please enter your Comment

    Comment should be atleast 30 Characters.

    Please put code inside [Code] your code [/Code].

    Please login to post comment

    No Comment Found, Be the First to post comment!

    Program to find vowel Occurances from a given string

    Program to allocate memory dynamically for strings, and store their addresses

    in array of pointers to strings

    Sorting of a sturcture of multiple keys

    Program to copy one string to another by coding and using string functionPrint reverse linked list

    Program to calculate months in a provided number of days from user

    Program to do subtraction of two numbers

    Program to get and set System Date using Interrupt 21h

    Program to do sum of the elements of the array using self scheduling

    RSS Feeds: Articles | Forum | New Users | Activities | Interview FAQ | Poll | Hotlinks

    Social Networking: Hall of Fame | Facebook | Twitter | LinkedIn

    Terms: Terms of Use | Privacy Policy | Contact us

    Copyright 2008-2012

    http://www.dmca.com/Protection/Status.aspx?ID=af722e18-04b2-47d9-b00f-40bdff76faf1http://www.dailyfreecode.com/ContactUs.aspxhttp://www.dailyfreecode.com/PrivacyPolicy.aspxhttp://www.dailyfreecode.com/TermsOfUse.aspxhttp://www.linkedin.com/groups?gid=3227304http://twitter.com/dailyfreecodehttp://www.facebook.com/DailyFreeCodehttp://www.dailyfreecode.com/HallofFame.aspxhttp://feeds.feedburner.com/syntaxexampleHotLinkshttp://feeds.feedburner.com/syntaxexamplePollRssFeedhttp://feeds.feedburner.com/syntaxexampleInterviewhttp://feeds.feedburner.com/syntaxexampleActivityLogRssFeedhttp://feeds.feedburner.com/syntaxexampleMembersRssFeedhttp://feeds.feedburner.com/syntaxexampleForumhttp://feeds.feedburner.com/syntaxexamplearticlesRssFeedhttp://www.dailyfreecode.com/Code/sum-elements-array-self-scheduling-1086.aspxhttp://www.dailyfreecode.com/Code/get-set-system-date-interrupt-21h-748.aspxhttp://www.dailyfreecode.com/Code/subtraction-two-numbers-2273.aspxhttp://www.dailyfreecode.com/Code/calculate-months-provided-number-days-1467.aspxhttp://www.dailyfreecode.com/Code/print-reverse-linked-list-2429.aspxhttp://www.dailyfreecode.com/Code/copy-string-another-coding-string-619.aspxhttp://www.dailyfreecode.com/Code/sorting-sturcture-multiple-keys-2876.aspxhttp://www.dailyfreecode.com/Code/allocate-memory-dynamically-strings-2812.aspxhttp://www.dailyfreecode.com/Code/find-vowel-occurances-given-string-2108.aspxhttp://__dopostback%28%27ctl00%24ctl00%24cc%24cm%24lnklogin%27%2C%27%27%29/