Q: Write A C++ program to find out the largest as well as the second largest element in an array(user input the elements first)?
note that every number is treated as a unique so largest or second largest can not be the same.
FOr EXAMPLE : 45 45 32 78 9 12
in this answer should come as largest =45 and second largest=32
EXAMPLE 2 : 12 10 11 4 10 12 23
in this answer should be like largest=233 and second largest =12
code here
note that every number is treated as a unique so largest or second largest can not be the same.
FOr EXAMPLE : 45 45 32 78 9 12
in this answer should come as largest =45 and second largest=32
EXAMPLE 2 : 12 10 11 4 10 12 23
in this answer should be like largest=233 and second largest =12
code here
Comments
Post a Comment
share your thoughts ....