Thread: wrote this program for Calculate the area of the circle but wants The answer will be

  1. #1
    Registered User
    Join Date
    Dec 2018
    Posts
    5

    wrote this program for Calculate the area of the circle but wants The answer will be

    wrote this program for Calculate the area of the circle program ready working but wants The answer will be displayed on The answer will be displayed
    on the New DOS screen Who can help me؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟ ؟؟؟؟



    program is ready working so just tell me what function must be use to
    answer will be displayed on the new DOS screen only:
    Code:
    #include <stdio.h>
    #include <conio.h>
    
    float area(float);
    int main()
    {
    float r, s;
    clrscr();
    printf("press enter to program start:");
    getchar();
    printf("\nenter the radius:");
    scanf("%f", &r);
    s = area(r);
    printf("\narea = %5.2f", s);
    getch();
    return 0;
    }
    //***********************
    float area(float r)
    {
    float s;
    s = r * r * 3.14;
    return s;
    }

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,526
    What does "new DOS screen" mean?

    DOS only has one screen, and that's the one your program is running in.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    May 2016
    Posts
    104
    You mean you want your answer on a new window? There's probably a system call for that, one of the guys here can probably be of more help.
    An alternative could be to clear the screen though, In windows that can be easily achieved by calling system("CLS"). You probably need to include <stdlib.h> to use it though.

  4. #4
    Registered User Kernelpanic's Avatar
    Join Date
    Sep 2018
    Location
    Berlin
    Posts
    103
    Of course, there was only one screen under MS-DOS, but for example one could programming windows with the graphics library that came with QuickC 2.5 a little bit a la Windows. One could create a kind of Windows with it. Like this example (I have tried install MS-DOS 6.22 and Windows 3.1/95 in the VBox - it would not work):

    wrote this program for Calculate the area of the circle but wants The answer will be-quickcfenster-jpg

    That are four windows on top of each other and every window is/was separate. It's modelled with Photoshop now.

    That is a part of the code . . .

    Code:
    /* 'kkuprzan.c' gehrt zu KREDITEX.C                                  */
    /* Kurs einer jhrlichen Annuittenschuld mit Prozentannuitten S.227 */
    /*                                                       - 24. 9.1996 */
    /*====================================================================*/
    
    
    #include <stdio.h>
    #include <stdlib.h>
    #include <conio.h>
    #include <math.h>
    #include <graph.h>
    
    
    #define CURSOR_AUS 0x2000
    #define CURSOR_NORMAL 0x0707
    
    
    extern void kurs_jaehrl_prozent_annuschuld( void );
    extern void kapital_effektiv_zins_menu( void );
    
    
    void kurs_pannu( double nominal_zins, double effektiv_zins, double p_annu );
    
    
    void kurs_jaehrl_prozent_annuschuld( void )
    {
        int vg_farbe, i, spalte;
        int azeile, aspalte, ezeile, espalte;
        unsigned int hg_farbe;
        double effektiv_zins, nominal_zins, prozent_annu;
        char puffer[64];
    
    
        hg_farbe = _getbkcolor();
        vg_farbe = _gettextcolor();
        _gettextwindow( &azeile, &aspalte, &ezeile, &espalte );
        //I think that was ist . . .
    
        _setbkcolor( 15L );
        _clearscreen( _GCLEARSCREEN );
        _settextcolor( 14 );
        _settextposition( 2, 8 );
        _outtext( "Kurs einer Annuitaetenschuld mit jaehrlicher Zinszahlung und Tilgung" );
        _settextposition( 3, 24 );
        _outtext( "bei Tilgung durch Prozentannuitaet" );
        . . .
    }
    Last edited by Kernelpanic; 12-29-2018 at 04:05 PM.

  5. #5
    Registered User
    Join Date
    Dec 2018
    Posts
    5

    Red face

    Quote Originally Posted by Dren View Post
    You mean you want your answer on a new window? There's probably a system call for that, one of the guys here can probably be of more help.
    An alternative could be to clear the screen though, In windows that can be easily achieved by calling system("CLS"). You probably need to include <stdlib.h> to use it though.

    yes want program answer on a new DOS screen show please more about system("CLS") and <stdlib.h> about new dos screen details tell me???

  6. #6
    Registered User
    Join Date
    Dec 2018
    Posts
    5
    Quote Originally Posted by Salem View Post
    What does "new DOS screen" mean?

    DOS only has one screen, and that's the one your program is running in.
    code exist and like this >>>
    include <stdlib.h>
    .
    .
    .
    system("dir C:\");
    system("cmd.exe /c dir c:\");

  7. #7
    Registered User
    Join Date
    Dec 2018
    Posts
    5
    ("CLS") i think for clear screen i think this kind code must be use if you know complete its and put this post :

    include <stdlib.h>

    system("dir C:");
    system("cmd.exe /c dir c:");
    printf("\narea = %5.2f", s);


  8. #8
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,526
    I suppose you could do
    system("cmd.exe /c echo this is a string");

    But it's a sucky way of printing things.
    For a start, you need to figure out how to stop the new window from disappearing almost immediately.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. calculate area of circle using pointers
    By DustBin in forum C Programming
    Replies: 4
    Last Post: 05-23-2016, 10:37 AM
  2. Problem with area of circle program
    By Drezden in forum C Programming
    Replies: 4
    Last Post: 01-27-2013, 07:42 PM
  3. area of a circle
    By wise_ron in forum C Programming
    Replies: 2
    Last Post: 10-02-2006, 03:15 PM
  4. Circle Area
    By Zophixan in forum C++ Programming
    Replies: 3
    Last Post: 11-05-2002, 12:50 PM
  5. Whats wrong with my find Circle Area program?[compiles fine]
    By Golden Bunny in forum C++ Programming
    Replies: 22
    Last Post: 06-16-2002, 02:49 PM

Tags for this Thread