Thursday, July 30, 2009

Write a C++ program to find the largest number from a list of numbers entered through keyboard.?

I won't write the C++ code, but I'll give you an algorithm of what you need to do in that language.





Testvariable = -1


Inputvariable = (input number from keyboard)


While (not end_of_file) do


If Inputvariable %26gt; Testvariable then


Testvariable = Inputvariable


endif


end while





That's the logic you'll need. Now, what you need to do is:


1) Make this correct in C++ syntax


2) Figure out how to do the keyboard input (using C++ syntax)





Good luck


No comments:

Post a Comment