Exforsys
+ Reply to Thread
Results 1 to 2 of 2

Need help Please C++

This is a discussion on Need help Please C++ within the C and C++ forums, part of the Programming Talk category; Write a C++ program that will prompt the user to input an employee number, a department code (single character A, ...

  1. #1
    n12063 is offline Junior Member Array
    Join Date
    Apr 2011
    Answers
    2

    Thumbs up Need help Please C++

    Write a C++ program that will prompt the user to input an employee number, a department code (single character A, B, or C), and a hourly wage. The program should then write this data, one employee per line, to a file. The hourly wage should be formatted to two decimal places.

    The second program should read the data from the file created in part 1 and display to the screen.

    Thanks!!


  2. #2
    sudha06 is offline Junior Member Array
    Join Date
    Mar 2011
    Answers
    15
    for instance, if the user enters number 4 ..the program should display:





    1


    22


    333


    4444





    * I did solve this Q:





    #include%26lt;iostream.h%26gt;


    void main() {


    int n;


    cin%26gt;%26gt;n;


    for(int i=1;i%26lt;=n;i++)


    {


    for(int j=0;i+j%26lt;=n;j++)


    cout%26lt;%26lt;i;


    cout%26lt;%26lt;"\n";


    }


    }


    }





    But when i run it on the compiler ... it gave this output





    1111


    222


    33


    4





    Can someone help plz..

    Write a c++ program that prompt the user to enter a number and then display a series of numbers as follows:?
    Change


    for(int j=0;i+j%26lt;=n;j++)


    to


    for(int j=1;j%26lt;=i;j++)
    Reply:#include %26lt;stdio.h%26gt;


    #include %26lt;conio.h%26gt;


    void main()


    {


    int i,j,k,x;


    clrscr();


    printf(" Enter A Num : ");


    scanf("%d",%26amp;x);


    k=1;


    for(i=1;i%26lt;=x;i++)


    {


    for(j=1;j%26lt;=i;j++)


    printf("%d",k);


    printf("\n");


    k++;


    }


    getch();


    } Report It

    Reply:#include%26lt;iostream.h%26gt;


    #include%26lt;conio.h%26gt;


    void main()


    {


    int n;


    cout%26lt;%26lt;"enter the number\n";


    cin%26gt;%26gt;n;


    for(int i=1;i%26lt;=n;i++)


    {


    for(int j=1;j%26lt;=i;j++)


    cout%26lt;%26lt;i;


    cout%26lt;%26lt;"\n";


    }


    getch();


    }
    Reply:... wtf is that?


Latest Article

Network Security Risk Assessment and Measurement

Read More...