Webhosting in Pakistan
Results 1 to 12 of 12

Thread: help C++

  1. #1
    Muzafar_B is offline Advance Member
    Last Online
    8th February 2019 @ 09:58 AM
    Join Date
    24 Jul 2013
    Location
    hyderabad
    Age
    27
    Gender
    Male
    Posts
    650
    Threads
    101
    Credits
    42
    Thanked
    15

    Default help C++

    Webhosting in Pakistan
    C++ ka program banana he 1 dimensional array se ap progra banana he
    2 C++ me marksheet nanani he marks ka user se poncha jay phir har subject ki marks display kar

  2. #2
    Muzafar_B is offline Advance Member
    Last Online
    8th February 2019 @ 09:58 AM
    Join Date
    24 Jul 2013
    Location
    hyderabad
    Age
    27
    Gender
    Male
    Posts
    650
    Threads
    101
    Credits
    42
    Thanked
    15

    Default

    koe to bata de

  3. #3
    khalliqie's Avatar
    khalliqie is offline Advance Member
    Last Online
    22nd May 2018 @ 02:18 PM
    Join Date
    02 Apr 2009
    Location
    Peshawar
    Age
    27
    Gender
    Male
    Posts
    2,493
    Threads
    141
    Credits
    773
    Thanked
    162

    Default

    #include<iostream.h>
    #include<conio.h>
    #include<string>
    void main()
    {
    string b;
    int a[4],result=0;
    cout<<"Please Enter Name of Student ";
    cin>>b;
    for(int i=0;i<=3;i++)
    {
    switch(i)
    {
    case 0:
    cout<<"Please Enter Marks for English ";
    cin>>a[i];
    break;
    case 1:
    cout<<"Please Enter Marks for Urdu ";
    cin>>a[i];
    break;
    case 2:
    cout<<"Please Enter Marks for Physics ";
    cin>>a[i];
    break;
    case 3:
    cout<<"Please Enter Marks for Computer Science ";
    cin>>a[i];
    break;
    default:
    cout<<"No Subject Selected"<<endl;
    break;
    }
    }
    for(int i=0;i<=3;i++)
    {
    result=result+a[i];
    }
    cout<<"\n"<<b<<"'s Total marks are "<<result<<" "<<endl<<b<<"'s Marks in each subject are given below"<<endl;
    for(int i=0;i<=3;i++)
    {
    switch(i)
    {
    case 0:
    cout<<"English Marks = "<<a[i]<<endl;
    break;
    case 1:
    cout<<"Urdu Marks = "<<a[i]<<endl;
    break;
    case 2:
    cout<<"Physics Marks = "<<a[i]<<endl;
    break;
    case 3:
    cout<<"Computer Science Marks = "<<a[i]<<endl;
    break;
    default:
    cout<<"No Subject Selected"<<endl;
    break;
    }
    }
    getch();
    }
    "The nicest people tend to often be the ones who have been mistreated the most."

  4. #4
    Muzafar_B is offline Advance Member
    Last Online
    8th February 2019 @ 09:58 AM
    Join Date
    24 Jul 2013
    Location
    hyderabad
    Age
    27
    Gender
    Male
    Posts
    650
    Threads
    101
    Credits
    42
    Thanked
    15

    Default

    switch me ni banana mujahe funtcion me bana k do

  5. #5
    khalliqie's Avatar
    khalliqie is offline Advance Member
    Last Online
    22nd May 2018 @ 02:18 PM
    Join Date
    02 Apr 2009
    Location
    Peshawar
    Age
    27
    Gender
    Male
    Posts
    2,493
    Threads
    141
    Credits
    773
    Thanked
    162

    Default

    #include<iostream.h>
    #include<conio.h>
    #include<string>
    int a[4];
    void results(int);
    // function
    void marks(int i)
    {
    if(i==0)
    {
    cout<<"Please Enter Marks for English ";
    cin>>a[i];
    }
    if(i==1)
    {
    cout<<"Please Enter Marks for Urdu ";
    cin>>a[i];
    }
    if(i==2)
    {
    cout<<"Please Enter Marks for Physics ";
    cin>>a[i];
    }
    if(i==3)
    {
    cout<<"Please Enter Marks for Computer Science ";
    cin>>a[i];
    }
    }

    //main function
    void main()
    {
    int result=0;
    string b;
    cout<<"Please Enter Name of Student ";
    cin>>b;
    for(int i=0;i<=3;i++)
    {
    marks(i);
    }
    for(int i=0;i<=3;i++)
    {
    result=result+a[i];
    }
    cout<<"\n"<<b<<"'s Total marks are "<<result<<" "<<endl<<b<<"'s Marks in each subject are given below"<<endl;
    for(int i=0;i<=3;i++)
    {
    results(i);
    }
    getch();
    }


    //function
    void results(int i)
    {
    if(i==0)
    cout<<"English Marks = "<<a[i]<<endl;
    if(i==1)
    cout<<"Urdu Marks = "<<a[i]<<endl;
    if(i==2)
    cout<<"Physics Marks = "<<a[i]<<endl;
    if(i==3)
    cout<<"Computer Science Marks = "<<a[i]<<endl;
    }

  6. #6
    khalliqie's Avatar
    khalliqie is offline Advance Member
    Last Online
    22nd May 2018 @ 02:18 PM
    Join Date
    02 Apr 2009
    Location
    Peshawar
    Age
    27
    Gender
    Male
    Posts
    2,493
    Threads
    141
    Credits
    773
    Thanked
    162

    Default

    Quote Muzafar_B said: View Post
    switch me ni banana mujahe funtcion me bana k do
    abhi jo banaya hai is program ko dekh le

  7. #7
    Muzafar_B is offline Advance Member
    Last Online
    8th February 2019 @ 09:58 AM
    Join Date
    24 Jul 2013
    Location
    hyderabad
    Age
    27
    Gender
    Male
    Posts
    650
    Threads
    101
    Credits
    42
    Thanked
    15

    Default

    mere pas trrbo c++ he 6 error dehrah he
    Good of luck

  8. #8
    Muzafar_B is offline Advance Member
    Last Online
    8th February 2019 @ 09:58 AM
    Join Date
    24 Jul 2013
    Location
    hyderabad
    Age
    27
    Gender
    Male
    Posts
    650
    Threads
    101
    Credits
    42
    Thanked
    15

    Default

    ok thanks kam hogy

  9. #9
    khalliqie's Avatar
    khalliqie is offline Advance Member
    Last Online
    22nd May 2018 @ 02:18 PM
    Join Date
    02 Apr 2009
    Location
    Peshawar
    Age
    27
    Gender
    Male
    Posts
    2,493
    Threads
    141
    Credits
    773
    Thanked
    162

    Default

    Quote Muzafar_B said: View Post
    ok thanks kam hogy
    u welcome brother

  10. #10
    Join Date
    18 Aug 2009
    Location
    ISLAMABAD
    Gender
    Male
    Posts
    465
    Threads
    39
    Credits
    816
    Thanked
    36

    Default

    #include<string.h> nahi aye ga?
    @ I LOVE ALL @

  11. #11
    khalliqie's Avatar
    khalliqie is offline Advance Member
    Last Online
    22nd May 2018 @ 02:18 PM
    Join Date
    02 Apr 2009
    Location
    Peshawar
    Age
    27
    Gender
    Male
    Posts
    2,493
    Threads
    141
    Credits
    773
    Thanked
    162

    Default

    Quote USMANHEART said: View Post
    #include<string.h> nahi aye ga?
    nai bro main ne try kia hai borland c++ IDE main string header file ke sath .h lagane se error araha tha.

  12. #12
    Shehzad Iqbal's Avatar
    Shehzad Iqbal is offline Advance Member+
    Last Online
    22nd November 2016 @ 07:12 PM
    Join Date
    16 Jan 2009
    Location
    Karachi
    Gender
    Male
    Posts
    28,453
    Threads
    2269
    Credits
    8,111
    Thanked
    5385

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •