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
The concept of a string in C is difficult, because a string is a collection of characters stored in memory terminated by a NULL string i.e. \0. Let us consider the string Hello. Th

#question write a prog c & cpp

In this assignment the main has been written for you in the file phone_book_main.cpp. You will also notice that a class called Person has been declared as having several prototypes

Employ operator () instead of operator[]. While you have multiple subscripts, the cleanest way to do it is along with operator () instead of with operator[]. The reason is that

A: 1.      By using const protects you against programming errors which inadvertently alter data. 2.      By using const allows function to procedure const and non-const actu


You are required to write a stand-alone DSP application in the C programming language. The overall objective of this application is to convert a signal from the time domain to t


If we take the input image and smooth it with a Gaussian of a significant size before computing the Canny edges does the number of edges change, and do the locations of these edges

You are going to write a function that computes the total interest charged on a credit card before it is paid off. List all the inputs the function will need.