answersLogoWhite

0


Best Answer

#include<stdio.h>

#include<conio.h>

void main()

{

int a,b;

clrscr();

printf("Enter two numbers");

scanf("%d,%d",&a,&b);

if(a>b)

{

printf("%d is greater",a);

}

else

{

printf("%d is greater",b);

}

getch();

}

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write maximum of two numbers in C programming?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Program in 'c' to find the LCM of any given five numbers?

Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.


How do you Write a value returning function using c programming that receives two floating point numbers and returns true if the first formal parameter is greater than the second.?

bool isBigger (float a, float b) { return a &gt; b;}


Write a c program to find the maximum of two numbers and print out with its position?

maxValue = function (array) {mxm = array[0];for (i=0; i&lt;array.length; i++) {if (array[i]&gt;mxm) {mxm = array[i];}}return mxm;}; i don't know


How do you write the code for generating Fibonacci search in C programming?

Use a lookup table. The first two elements are 0 and 1 and each subsequent element is the sum of the preceding two elements. The table needn't be very large as there are only 43 Fibonacci numbers in the range 0 to 1 billion. If you need larger numbers, use long doubles.


How do you find the largest of 3 numbers in computer programming?

To find the largest of three numbers you must first find the largest of two numbers: int max (int a, int b) { return a&gt;b?a:b; // or, equivalently: if (a&gt;b) return a; else return b; } Now we can use this function to find the maximum of three: int max3 (int a, int b, int c) { return max (max (a,b), c); }

Related questions

How to write a C program to find largest 2 numbers using pointers?

program to find maximum of two numbers using pointers


What are the maximum numbers of diagonal a quadrilateral can have?

Two of them


What is the maximum product of two numbers if their sum is 48?

the two numbers can only be 24 and24


If the square of two numbers is one and the product is maximum?

If the two numbers are x and y, thenthe square of the two numbers is one => (xy)^2 = 1 which implies that xy = +/-1.Then xy is a maximum => xy = 1.


The sum of two whole numbers is 33 what is their maximum product?

272 is the maximum possible.


Two real numbers whose sum is S and whose product is a maximum?

find two positive numbers whose product is a maximum. 1.) the sum is s.


How to write two thousand two hundred twenty six in numbers?

2,226. this is the way to write two thousand, two hundred and twenty six in numbers.


What is the maximum number of rational number between any two rational numbers?

There are [countably] infinite rational number between any two rational numbers. There is, therefore, no maximum.


What is the maximum product of two numbers if their sum is 124?

3844


What is the maximum product of two numbers that add to 46?

529.


The sum of two numbers is 12 Find the two numbers if the sum of their squares is to you a maximum?

Assuming the two numbers must be positive whole numbers, the answer is 1 and 11. If they need to be non-negative, it is 0 and 12. If negative numbers are permitted (eg -1 and 13) there is no limit to the sum - ie there is no maximum.


What if two numbers are the median?

Then you write down both numbers