Program is to find the maximum from two numbers, C/C++ Programming

Program is to find the maximum from two numbers:

Program is to find the maximum from two numbers entered by the user having pointer variable as parameter

void main()

  {

  clrscr();

  int a,b,ans;

  cout<<" enter the first number ";

  cin>>a;

  cout<<" enter the second number ";

  cin>>b;

  ans=*max(&a,&b);

  cout<<" The maximum of two numbers is :"<

  }

 

int *max(int *a,int *b)

  {

  if (*a>*b)

   return a;

  else

    return b;

  }

Posted Date: 10/19/2012 7:55:16 AM | Location : United States







Related Discussions:- Program is to find the maximum from two numbers, Assignment Help, Ask Question on Program is to find the maximum from two numbers, Get Answer, Expert's Help, Program is to find the maximum from two numbers Discussions

Write discussion on Program is to find the maximum from two numbers
Your posts are moderated
Related Questions
Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Each function has its own stack frame between %fp and %sp. Let Caller calls Callee. Then Caller's %sp becomes callee's %fp, and callee's %sp set to be a new value (a smaller one be

Within programs we very often want to execute a different section of code, depending upon various conditions within C the If statement is used to achieve this. The If statement con

What are Arrays? Numerous applications require the processing of multiple data items that have identical characteristics. In such circumstances it is frequently convenient to p

Program to design text styles: Write a C program to design different text style char *fname[] = { "DEFAULT font",                                   "TRIPLEX font",

I am seeking an expert to create a 360 degree virtual tour in KRPano for use on PCs, tablets and smartphones. You will be given with panoramas in order to create an advanced KRPano

A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation. For a string of t

find the area of a curve y=f(x) between x=a and x=b integrate f(x) between limits a and b   #include float start_point, /* GLOBAL VARIABLES */

how to make the coding

A: auto: the default. Variables are created and initialized automatically while they are defined and destroyed at the ending of the block containing their definition. They are not