Lab PF

Selection Statements & Relational Operators

Deadline of submission is Wednesday 04/21/2021 at 11pm 
All Operators which can be used with conditional statements:

Assignment Tasks:

Q1- Write a program in C++. Initialize integer variable and take input form user check if user entered positive value (Greater than 0) then you program should output “Positive Number Entered” if user entered negative number (Less than Zero) then it should print “Negative number on the Console.

Q2- Write a Program in C++. You are going to design system “Currency rate Teller Machine” which tells about the Current currency rate According to Pakistani Rupees only. For instant if user entered ‘$’ your system print the rate of Dollar according to Pakistani rupees same goes for the Different currencies rates.
Hint: You can check All Currency rates and Symbols using internet available in the lab.

Q3- Write a program in C++. Your program should check two numbers (number could be integers, floats, double etc.) and output the greater number & it should also check equality between entered numbers.

Q4- Write a program in C++. Your program should check two integers print ‘not equal’ if their values are different print ‘equal’ if their values are same.

Q5- what will be the output of the program:

   if(0)
          {
                cout<<"here i'm"<<endl;
          }
     else
        {
           cout<<"here in else"<<endl;
        }

for help:


#peepgramers: comment any of your program to the post comment section.
Submission Link:



23 Comments

  1. This comment has been removed by the author.

    ReplyDelete
  2. here in else is the output of Q5
    Name :Muhammad Wasif Nazir.
    class:BSCS sectionA1.
    CMS NO:406084.

    ReplyDelete
  3. #include
    using namespace std;
    int main()
    {

    if(0)
    {
    cout<<"here i'm"<<endl;
    }
    else
    {
    cout<<"here in else"<<endl;
    }
    system("pause");
    return 0;
    }






    output


    here is else
    press any key to continue......

    ReplyDelete
  4. #include
    using namespace std;
    int main()
    {
    if(0)
    {
    cout<<"here i'm"<<endl;
    }
    else
    {
    cout<<"here in else"<<endl;
    }
    system("pause");
    return 0;
    }

    ReplyDelete
  5. here in else
    is output
    M. Aamir Shabbir
    Cms no: 406125

    ReplyDelete
  6. sir i tried several time to write a accurate program but i do not got seccessed in if else programming

    ReplyDelete
  7. Question#5
    output: "here in else"
    Sarmad hassan
    CMS#406324


    ReplyDelete
  8. Question#5

    The Output Is "here in else"

    regards

    Usaid Khan

    CMS:-405839

    ReplyDelete
  9. Question # 5
    The output is "here in else"
    M Sameer Sohail
    CMS : 406423

    ReplyDelete
  10. Question#5
    Output: here in else
    Madni Fareed
    CMS:
    406323

    ReplyDelete
  11. here in else
    Name. Faizan ahmed
    CBS. 406201

    ReplyDelete
  12. question no 5
    here is else
    Name :laiq ahmed
    CMS:406985

    ReplyDelete
  13. Muhammad taha
    cms 406403
    output of Q#5 is "here in else"

    ReplyDelete
  14. Output: here in else
    Name: Farzal Ali
    CMS: 406812

    ReplyDelete
  15. Q#05

    here is else

    Name :M Umair Anjun
    CMS:406266

    ReplyDelete
  16. output Q5 : here is else
    Name: Abdullah jaral
    CMS: 406222

    ReplyDelete
  17. Output is "here is else"

    Sorry for late sir ! 😛

    ReplyDelete
  18. zaka-ul-hassan
    sap id 27019
    #include
    using namespace std;
    int main()
    {
    int a;
    cout << "enter a number";
    cin >> a;
    if (a > 0) {
    cout << "it is positive";
    }
    else {
    cout << "it is negative";
    }

    ReplyDelete
  19. Musab Shoaib
    Sap Id:27181
    #include
    using namespace std;
    int main()
    {

    if(0)
    {
    cout<<"here i'm"<<endl;
    }
    else
    {
    cout<<"here in else"<<endl;
    }
    system("pause");
    return 0;
    }






    output


    here is else

    ReplyDelete
  20. Name=Rafaqat Ali
    SAP:23524
    Section:E
    Question 1

    #include

    using namespace std;

    int main()

    {
    int a;

    cin>>a;

    if(a<0)

    {

    cout<<"negative";

    }

    else

    {

    cout<<"poitive";

    }

    return 0;

    {
    Question 2
    #include
    using namespace std;
    int main()
    {
    char a;
    cin>>a;
    if(a=='$')
    {
    cout<<"150";
    }
    if(a=='E')
    {
    cout<<"200";
    }
    return0;
    }
    Question 3
    #include
    using namespace std;
    int main()
    {
    int a;
    int b;
    cin>>a
    c>>b;
    if(a==b)
    {
    cout<<"both are equal";
    }
    if(a>b)
    {
    cout<a)
    {cout<
    using namespace std;
    int main()
    {
    int a;
    int b;
    cin>>a;
    cin>>b;
    if(a==b)
    {
    cout<<"both are equal";
    }if(a!=b)
    {
    cout<<"both are not equal";
    }
    return 0;
    }
    Question 5
    #include
    using namespace std;
    int main()
    {
    if(0)
    {
    cout<<"here i am";
    }
    else
    {
    cout<<"here in the else";
    }
    return 0;
    }

    ReplyDelete

Post a Comment

Previous Post Next Post