//i hope its something like this you want
import java.util.*;
public class Count
{
public static void main(String args[])
{
double numbers;
Scanner scan;
int counter;
numbers=0;
scan=new Scanner(System.in);
for(counter=1; counter<=10; counter++)
{
System.out.println("Please enter numbers");
numbers=scan.nextDouble();
{
System.out.println("The number is "+numbers++);
}
}
}
}
#include
#include
int main()
{int a[10];
printf("enter 10 numbers:\n");
for(int i=0;i<=9;i++)
{printf("enter %d number\n",i+1);
scanf("%d",&a[i]);
}
printf("NUMBER SQUARE\n");
for(int j=0;j<=9;j++)
{printf("%d %d\n",a[j],(a[j]*a[j]));
}
getch();
return 0;
}
I would use an array here, since this can easily be extended to more than 3 numbers. Something like this (assuming you already created the array):
maxValue = myArray[1];
for (int i = 1; i < myArray.length(); i++)
if (myArray[i] > maxValue)
maxValue = myArray[i]
CLS
PRINT "PROGRAM: Add up 10 numbers entered from the keyboard;"
PRINT " then, printout their sum total."
sumTotal = 0
FOR eachNo% = 1 TO 10
IF eachNo% < 10 THEN PRINT " ";
PRINT eachNo%; "> ";
INPUT "Enter number: ", number
sumTotal = sumTotal + number
NEXT
PRINT "The sum total of your 10 numbers is: "; sumTotal
END
To write a C++ program to display the student details using class and array of object.
you do this 10 print "0112358132134" use the whole of the thing
identification division. program-id. greatest. environment division. data division. working-storage section. 77 a pic 999. 77 b pic 999. 77 c pic 999. procedure division. greatest. display "ENTER THE THREE NUMBERS:". accept a. accept b. accept c. if a > b and a > c display a "is greatest" else if b > c display b "is greatest" else display c "is greatest". display " thank you". stop run.
Write a program which takes the temperature in farhenheight.the program should display the farhenheight temperature as well as centigrade. C= (f-32)*5/9
A C++ program can be used to write C programs that will display 10 lines of biodata. Many types of C programming can be written with a C++ program.
To write a C++ program to display the student details using class and array of object.
By learning how to program on C+.
program to find maximum of two numbers using pointers
you do this 10 print "0112358132134" use the whole of the thing
largest of a, b, c :a > b ? a > c ? a : c : b > c ? b : c
I know how to do this and you need to know how to do this. Why don't you do your best at writing this program and if it does not work then ask for help. You will not learn anything if I give you the answer.
Write a function that implements an algorithm that checks to see if a particular integer is prime (returning a boolean). Write a program that uses that function on each number from 1 to 100, and if true, displays that number.
write a program to display your name age class schoolname e-mail 2hobby based on choice
Faisal
#include<iostream> int main (void) { int a, b; std::cout << "Enter two whole numbers:"; std::cin >> a >> b; std::cout << "The largest of " << a << " and " << b << " is << (a>b?a:b) << std::endl; }
#include <stdio.h> int main (void) { puts ("0123456789"); return 0; }
Read 2 numbers. If first is larger than second, display second, else display first. That's for the smallest. For the largest reverse the two. For each of the other two, it's easier to just create a variable, call it largest. Initialize it to a very small number, say -1. As you read each number, compare it to largest. If the number is larger than largest, set largest equal to the number. When you finish each list of numbers, then print largest. Best answer Read 2 numbers. If first is larger than second, display second, else display first. That's for the smallest. For the largest reverse the two. For each of the other two, it's easier to just create a variable, call it largest. Initialize it to a very small number, say -1. As you read each number, compare it to largest. If the number is larger than largest, set largest equal to the number. When you finish each list of numbers, then print largest.