Answer to Question #24713 in C++ for parth dev

Question #24713
here are 2 programme ...plz tell me which of the output or outputs will be displayed in each one...AND ALSO MENTION HOW CAN U FIND THE OUTPUT RELATED TO SUCH QUESTION ~

1)
#include<iostream.h>
#include<stdlib.h>
const int limit = 4;
void main()
{
randomize();
int points;
points = 100 + random(limit);
for(int p = points ; p>= 0 ;p--)
cout<<p<<"\t";
cout<<endl;
}

possible outputs ----
a)103 102 101 100
b)100 101 102 103
c)100 101 102 103 104
d)104 103 102 101 100


2)#include<iostream.h>
#include<stdlib.h>
void main()
{
randomize();
int guess,high = 4;
guess = random(high) + 50 ;
for (int c = guess ; c<=55 ; c++0
cout<<c<<"\t";
}


possible output ~
a)50 51 52 53 54 55
b)52 53 54 55
c)53 54
d)51 52 53 54 55


plz reply at the earliest .. i have an exam after few days...
1
Expert's answer
2013-02-20T10:30:38-0500
You can compile and run this code.
i) There is no possible outputs, because loop cantainsmore then 100 iterations
ii) b

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS