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
#include stdio.h> #include conio.h> #include string.h>   void main() {           char a[50],b[25][25],l[25],temp1;           int i=0,j=0,k=0,l1[25],c=0,c1=0,t=

Program is to search for a given character in a string: Program is to search for a given character in a string and print point of match char *stsearch(char *string, char sea

Aim: To implement a program to convert time in 24 hour format to 12 hour format. Code:                       #include #include #include class time24 {

Define  T y pe c o m p a t i b i li t y? T o a s s i g n i n t t o s m a l l i n t t h e v a r i a b l e should b e

Differences between a pointer and a reference 1.  A reference must always point to some object where as this restriction is not imposed on a pointer. e.g. int *pi = 0;

Define a structure of student class:  Write a program to define a structure of student record in C. class student { char name[20]; int roll_no; int marks[2];

What are  P r im a r y D a t a T y p es? Integer can be defined according to the size of the data and it can be modified further by using keyword unsigned and si

Given an integer n and a permutation of numbers 1, 2 ... , n-1, n write a program to print the permutation that lexicographically precedes the given input permutation. If the given

wap to print padovan string in c

A palindrome is a string that reads the same from the both the ends. Given a string S convert it to a palindrome by doing character replacement. Your takes is to convert S to palin