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

Do class declarations end with a semicolon? Do class method definitions?

1086


What do manipulators do?

964


What is a local reference?

1142


Explain the differences between private, public and protected and give examples.

960


Should the this pointer can be used in the constructor?

975


Define linked lists with the help of an example.

983


How does class accomplish data hiding in c++?

1121


What are the different types of comments allowed in c++?

937


Why we use #include conio h in c++?

994


What is the basic of c++?

1020


Is c# written in c++?

925


Which c++ compiler is best?

1097


True or false, if you keep incrementing a variable, it will become negative a) True b) False c) It depends

2314


Declare a class vehicle and make it an abstract data type.

925


What are the advantages of early binding?

1014