(defun max3 (a b c)
(cond ((> a b) (cond ((> a c) a) (t c)))
((> b c) b)
(t c)
)
)
// HI THIS IS MAYANK PATEL /*C Program to find Maximum of 3 nos. using Nested if*/ #include<stdio.h> #include<conio.h> void main() { int a,b,c; // clrscr(); printf("Enter three number\n\n"); scanf("d%d",&a,&b,&c); if(a>b) { if(a>c) { printf("\n a is maximum"); } else { printf("\n c is maximum"); } } else { if(b>c) { printf("\n b is maximum"); } else { printf("\n c is maximum"); } } getch(); }
Cls input "enter two no.s ",a,b sum=a+b print "sum = ";sum end
// largest = largest of a, b, c public class largest { public static void main(String args[]) { int a,b,c,largest; a=0; b=0; c=0; a=Integer.parseInt(args[0]); b=Integer.parseInt(args[1]); c=Integer.parseInt(args[2]); largest=a>b?(a>c?a:c):(b>c?b:c); System.out.println("The largest no. of "+a+","+b+"and"+c+"is"+largest); } }
You write it exactly the same as you would write it in any other verions of C++, by taking user input to determine the three sides of your triangle. In other words, input three real numbers. What you do with those three numbers is entirely up to you, but presumably you'd want to calculate the angles of a triangle given the length of its three sides. For that you would need to use the cosine rule which states that for any triangle with angles A, B and C whose opposing sides are a, b and c respectively, cos A = (b2 + c2 - a2)/2bc and cos B = (c2 + a2 - b2)/2ca. Knowing two angles, A and B, you can easily work out that angle C must be 180 - (A + B).
#include<stdio.h> #include<conio.h> void main() { int a,b,c; int Result; printf("enter the value of a:"); scanf("%d", &a); printf("enter the value of b"); scanf("%d", &b); printf("enter the value of c"); scanf("%d", &c); Result=a*b*c; printf("%d", Result); getch(); }
write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? check bellow link http://bashscript.blogspot.com/2009/08/gcd-of-more-than-two-numbers.html
// HI THIS IS MAYANK PATEL /*C Program to find Maximum of 3 nos. using Nested if*/ #include<stdio.h> #include<conio.h> void main() { int a,b,c; // clrscr(); printf("Enter three number\n\n"); scanf("d%d",&a,&b,&c); if(a>b) { if(a>c) { printf("\n a is maximum"); } else { printf("\n c is maximum"); } } else { if(b>c) { printf("\n b is maximum"); } else { printf("\n c is maximum"); } } getch(); }
largest of a, b, c :a > b ? a > c ? a : c : b > c ? b : c
"The sum of a number and three times another number is 18. find the numbers if their product is a maximum?"
3000
3,000,000,000,000
303.02
The correct way to write it in numbers is: 5,008,023.
Cls input "enter two no.s ",a,b sum=a+b print "sum = ";sum end
If you have 3 modes, write down the three as your answer. If the mode has two numbers, just write one of the numbers down.Repeat on the other two modes.
To find the maximum of three numbers using JSP, you can create a simple form to accept three numbers as input. Upon form submission, you can use JSP scriptlets to compare the numbers and determine the maximum. Here’s a basic example: <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <title>Find Maximum of Three Numbers</title> </head> <body> <form method="post"> Number 1: <input type="number" name="num1"><br> Number 2: <input type="number" name="num2"><br> Number 3: <input type="number" name="num3"><br> <input type="submit" value="Find Maximum"> </form> <% String num1Str = request.getParameter("num1"); String num2Str = request.getParameter("num2"); String num3Str = request.getParameter("num3"); if (num1Str != null && num2Str != null && num3Str != null) { int num1 = Integer.parseInt(num1Str); int num2 = Integer.parseInt(num2Str); int num3 = Integer.parseInt(num3Str); int max = Math.max(num1, Math.max(num2, num3)); out.println("Maximum number is: " + max); } %> </body> </html> This program displays a form to input three numbers and outputs the maximum number after submission.
13.03