Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write a program and call it sortcheck.cpp which receives 10 numbers from input and checks whether these numbers are in ascending order or not. You are not allowed to use arrays. You should not define more than three variables

Answer Posted / jobbine joseph

int main()
{
int Reading_num,Previou_num=-999999,i=0;
for(i=0;i<10;i++)
{
cin>>Reading_num;
if(Reading_num < Previous_num)
{
break;
}
Previous_num = Reading_num;
}
if(i<10)
{
cout<<"Numbers are Not in ASCENDING";
}
else
{
cout<<"Numbers are in ASCENDING ";
}

return(0);
}

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between #import and #include?

1019


Write a c program for binary addition of two 8 bit numbers.

4077


What is c++ iterator?

1081


Which bit wise operator is suitable for turning off a particular bit in a number?

1081


Can the creation of operator** is allowed to perform the to-the-power-of operations?

969


How many types of modularization are there in c++?

1045


What is abstraction in c++?

1309


Give example of a pure virtual function in c++?

1118


Explain overriding.

961


What is the full form of c++?

1282


What should main() return in c and c++?

997


What is auto type c++?

1086


What is difference between n and endl in c++?

1051


What are the various compound assignment operators in c++?

949


What are built-in functions? What is the syntax for the definition?

1045