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 oops in c++?

1049


Is map ordered c++?

1084


Differentiate between an external iterator and an internal iterator? What is the advantage of an external iterator.

1035


What will strcmp("Astring", "Astring"); return a) A positive value b) A negative value c) Zero

1084


What does namespace mean in c++?

1065


How long does it take to get good at leetcode?

1162


Write a struct time where integer m, h, s are its members?

949


What do you mean by ‘void’ return type?

1046


Does c++ have string data type?

1093


Where do I find the current c or c++ standard documents?

1079


Explain the difference between new() and malloc() in c++?

1123


What are special characters c++?

1015


What is c++ array?

1093


Explain the difference between static and dynamic binding of functions?

1050


an operation between an integer and real always yeilds a) integer result b) real result c) float result

1140