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

C program to add, average and deviation of numbers: void main() {                 int sum=0,a[10],i;                 float avg=0,dev,vari=0,var;                 pri

At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with thes

Define the C Preprocessor? Preprocessor' is a translation stage that is applied to your source code before the compiler proper gets its hands on it usually the preprocessor per

write aprogram for random -search to implement if a[i]=x;then terminate other wise continue the search by picking new randon inex into a

Static Variables Static variables have the similar scope s automatic variables, but, unlike automatic variables, static variables retain their values over number of function ca

Description A long time ago in a galaxy far, far away, the country Mafghanistan had n cities and m old roads, where each road connected a pair of cities. Due to the treacherous mo

Write a ‘C’ program to accept any 3 digit integer number from the keyboard and display the word equivalent representation of the given number.

I need Cryengine Sandbox Speedometer and Tachometer We want to get working Tachometer and Speedometer for a car in latest Cryengine Sandbox. You will find how to make it usin

programing code on board coloring in clanguage