Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

find big no between 2 using 3 variables in cpp

This is a discussion on find big no between 2 using 3 variables in cpp within the C and C++ forums, part of the Software Development category; how we calculate the big no between 2 using 3 variables such as x,y,big=0 using if statement in cpp....

Go Back   Geeks Talk > Software Development > C and C++
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 09-08-2009
Junior Member
 
Join Date: Jul 2009
Location: India
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
vedantv23 is on a distinguished road
Smile find big no between 2 using 3 variables in cpp

how we calculate the big no between 2 using 3 variables such as x,y,big=0 using if statement in cpp.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-17-2009
Junior Member
 
Join Date: Apr 2008
Location: Hyderabad
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
pavan.mustyala is on a distinguished road
Re: find big no between 2 using 3 variables in cpp

Hi!! finding bigger of 2 numbers in C/CPP :

Solution1 :
if(x > y)
{
big = x;
}
else if(x < Y)
{
big = y ;
}
else
{
//Actually both are equal
//we can Assign x or y to big
}

Solution2 : in a single statement.

big = (x > y) ? x : y ;
Reply With Quote
  #3 (permalink)  
Old 1 Week Ago
Junior Member
 
Join Date: Nov 2009
Location: tirupati
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
mallikarjuna143 is on a distinguished road
Re: find big no between 2 using 3 variables in cpp

#include<iostream.h>
void main()
{
int a=10,b=20,c;
if(a>b)
{
cout<<" A IS BIG "<<endl;
int big=a;
cout<<big;
}
}
Reply With Quote
Reply

  Geeks Talk > Software Development > C and C++

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
QTP environmental variables kanth QTP 1 05-23-2009 02:33 AM
Session Variables C D Raghavendra ASP.NET 1 08-04-2008 02:48 AM
How to declare variables in SP? bharathi_ark SQL Server 4 10-01-2007 08:38 AM
Environment variables in qtp gouthami123 QTP 1 06-22-2007 03:51 AM
Environment Variables nehalshah Unix/Linux 4 01-12-2007 05:13 AM


All times are GMT -4. The time now is 10:31 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved