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:
This comment has been removed by the author.
ReplyDeletehere in else is the output of Q5
ReplyDeleteName :Muhammad Wasif Nazir.
class:BSCS sectionA1.
CMS NO:406084.
#include
ReplyDeleteusing 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......
here in else
ReplyDelete#include
ReplyDeleteusing namespace std;
int main()
{
if(0)
{
cout<<"here i'm"<<endl;
}
else
{
cout<<"here in else"<<endl;
}
system("pause");
return 0;
}
here in else
ReplyDeletehere in else
ReplyDeleteis output
M. Aamir Shabbir
Cms no: 406125
sir i tried several time to write a accurate program but i do not got seccessed in if else programming
ReplyDelete"here in else"
ReplyDeleteis the output
Question#5
ReplyDeleteoutput: "here in else"
Sarmad hassan
CMS#406324
Question#5
ReplyDeleteThe Output Is "here in else"
regards
Usaid Khan
CMS:-405839
Question # 5
ReplyDeleteThe output is "here in else"
M Sameer Sohail
CMS : 406423
Question#5
ReplyDeleteOutput: here in else
Madni Fareed
CMS:
406323
here in else
ReplyDeleteName. Faizan ahmed
CBS. 406201
question no 5
ReplyDeletehere is else
Name :laiq ahmed
CMS:406985
Muhammad taha
ReplyDeletecms 406403
output of Q#5 is "here in else"
Output: here in else
ReplyDeleteName: Farzal Ali
CMS: 406812
Q#05
ReplyDeletehere is else
Name :M Umair Anjun
CMS:406266
output Q5 : here is else
ReplyDeleteName: Abdullah jaral
CMS: 406222
Output is "here is else"
ReplyDeleteSorry for late sir ! 😛
zaka-ul-hassan
ReplyDeletesap 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";
}
Musab Shoaib
ReplyDeleteSap 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
Name=Rafaqat Ali
ReplyDeleteSAP: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;
}
Post a Comment