Please update your Flash Player to view content.

Online Users

0 users and 739 guests online

Tech Star

Weekly Toppers

Monthly Winners

  • images/stories/gifts/Gouthmi.jpg
  • images/stories/gifts/Mahesh.jpg
  • images/stories/gifts/Naresh.jpg
  • images/stories/gifts/Nithin.jpg
  • images/stories/gifts/Sravya.jpg
  • images/stories/gifts/Subramanyam.jpg
  • images/stories/gifts/Usha.jpg
  • images/stories/gifts/gajavelly.jpg

Top Earners

Daily Toppers

Last Points Earned

Tech Shatabdhi Radio


Birthday Techies

Latest Updates

Win A Weekly Video Library Contest Started


Added 100% compatibility to all mobile phones


Interview Experiences module Added


Weekly toppers, star of the day modules added.


Certificates and points sent to August Winners.


Win A Weekly Video Library Contest Started


Added 100% compatibility to all mobile phones


Interview Experiences module Added


Weekly toppers, star of the day modules added.


Certificates and points sent to August Winners.


Win A Weekly Video Library Contest Started


Added 100% compatibility to all mobile phones


Interview Experiences module Added


Weekly toppers, star of the day modules added.


Certificates and points sent to August Winners.


Win A Weekly Video Library Contest Started


Added 100% compatibility to all mobile phones


Interview Experiences module Added


Weekly toppers, star of the day modules added.


Certificates and points sent to August Winners.


Win A Weekly Video Library Contest Started


Added 100% compatibility to all mobile phones


Interview Experiences module Added


Weekly toppers, star of the day modules added.


Certificates and points sent to August Winners.


Win A Weekly Video Library Contest Started


Added 100% compatibility to all mobile phones


Interview Experiences module Added


Weekly toppers, star of the day modules added.


Certificates and points sent to August Winners.


Win A Weekly Video Library Contest Started


Added 100% compatibility to all mobile phones


Interview Experiences module Added


Weekly toppers, star of the day modules added.


Certificates and points sent to August Winners.


Win A Weekly Video Library Contest Started


Added 100% compatibility to all mobile phones


Interview Experiences module Added


Weekly toppers, star of the day modules added.


Certificates and points sent to August Winners.


Win A Weekly Video Library Contest Started


Added 100% compatibility to all mobile phones


Interview Experiences module Added


Weekly toppers, star of the day modules added.


Certificates and points sent to August Winners.


Win A Weekly Video Library Contest Started


Added 100% compatibility to all mobile phones


Interview Experiences module Added


Weekly toppers, star of the day modules added.


Certificates and points sent to August Winners.


Win A Weekly Video Library Contest Started


Added 100% compatibility to all mobile phones


Interview Experiences module Added


Weekly toppers, star of the day modules added.


Certificates and points sent to August Winners.


Win A Weekly Video Library Contest Started


Added 100% compatibility to all mobile phones


Interview Experiences module Added


Weekly toppers, star of the day modules added.


Certificates and points sent to August Winners.


Win A Weekly Video Library Contest Started


Added 100% compatibility to all mobile phones


Interview Experiences module Added


Weekly toppers, star of the day modules added.


Certificates and points sent to August Winners.


Win A Weekly Video Library Contest Started


Added 100% compatibility to all mobile phones


Interview Experiences module Added


Weekly toppers, star of the day modules added.


Certificates and points sent to August Winners.


Win A Weekly Video Library Contest Started


Added 100% compatibility to all mobile phones


Interview Experiences module Added


Weekly toppers, star of the day modules added.


Certificates and points sent to August Winners.


Win A Weekly Video Library Contest Started


Added 100% compatibility to all mobile phones


Interview Experiences module Added


Weekly toppers, star of the day modules added.


Certificates and points sent to August Winners.


Welcome, Guest
Please Login or Register.    Lost Password?

How to find Greater Number within 3 No ?
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: How to find Greater Number within 3 No ?
#12498
How to find Greater Number within 3 No ? 10 Months, 3 Weeks ago Karma: 0
Hi Friends,

Can any one help me how to find Greater number with in 3 Number.
Suppose I passed a=23,b=34,c=45 then I need to know whether a is greater or b or c with value.

in this case Output should be like this : C
45
sharma.dhiraj87 (User)
Fresh Boarder
Posts: 14
graphgraph
Points: 17315
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#12499
Re:How to find Greater Number within 3 No ? 10 Months, 3 Weeks ago Karma: 2
Hi,

Try this program to find greater than 3 number in C# like this


using System;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
// declare 3 variables x,y,z
int x, y, z;
// assign values 5,10,20
x = 5;
y = 10;
z = 20;
// output the greatest number out of three
Console.WriteLine(greatest(x,y,z));
if (x > y && x > z)
Console.WriteLine("{0} is greater",x);
else if (y > x && y > z)
Console.WriteLine("{0} is greater",y);
else if (z > x && z > y)
Console.WriteLine("{0} is greater",z);
else
Console.WriteLine("All are equal"Wink;
} // #end Main()
}

Thanks,
Mahesh
durgammahesh22 (User)
Keep Smiling
Platinum Boarder
Posts: 368
graphgraph
Points: 418695
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Mahi Location: Hyderabad Birthday: 09/22
The administrator has disabled public write access.
Thanks
Mahesh
 
#12500
Re: How to find Greater Number within 3 No ? 10 Months, 3 Weeks ago Karma: 0
Use Lambda expressions for these type of problems.. Its quite faster...

using System;
using System.Linq;

class findMax
{
static void Main()
{
int[] arrayNo = { 23, 34, 45 };

// Find maximum number.
Console.WriteLine(arrayNo.Max());
}
}
harihara.muvvala (Moderator)
Administrator
Posts: 202
graphgraph
Points: 441997
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: Bangalore Birthday: 04/09
The administrator has disabled public write access.
 
#12501
Re:How to find Greater Number within 3 No in SQL ? 10 Months, 2 Weeks ago Karma: 0
Create proc [dbo].[FindMax] (@p1 INT, @p2 INT,@p3 int)
as
Begin

select * from
(select 'p1' as nm,@p1 as val
union all
select 'p2' nm,@p2 val
union all
select 'p3' nm,@p3 val) test order by val

END

Test By this :
DECLARE @return_value int

EXEC @return_value = [dbo].[FindMax]
@p1 = 34,
@p2 = 23,
@p3 = 45

SELECT 'Return Value' = @return_value

GO
sharma.dhiraj87 (User)
Fresh Boarder
Posts: 14
graphgraph
Points: 17315
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#12517
Re:How to find Greater Number within 3 No in SQL ? 8 Months, 4 Weeks ago Karma: 0
Modified above query.

alter proc [dbo].[FindMax] (@p1 INT, @p2 INT,@p3 int,@val int output)
as
Begin

select @val=MAX(val) from
(select 'p1' as nm,@p1 as val
union all
select 'p2' nm,@p2 val
union all
select 'p3' nm,@p3 val) test --order by val
return @val
END

DECLARE @return_value int

EXEC [dbo].[FindMax]
@p1 = 34,
@p2 = 23,
@p3 = 45,
@val= @return_value output
SELECT 'Return Value' = @return_value

GO


----------------
SQL 2008 and above versions we can use below query.

DECLARE @p1 int= 34, @p2 int= 23, @p3 int= 45
select MAX(val) val
from (VALUES (@p1),(@p2),(@p3)) AS FIND(val)
email2bag (User)
Fresh Boarder
Posts: 5
graphgraph
Points: 6248
graphgraph
User Offline Click here to see the profile of this user
Gender: Male email2bag
The administrator has disabled public write access.
 
Go to topPage: 1
Moderators: chandu, harihara.muvvala, usham
Your online TV