Write a Program that Inputs 10 Numbers in an Array and Show the Maximum Number
Answers were Sorted based on User's Feedback
Answer / aroosa naseer
import java.util.*;
class ArraysMax{
public static void main(String args[]){
int a[]=new int[10];
int max=0;
int temp;
Scanner scan=new Scanner(System.in);
System.out.println("Enter 10 numbers to find
out maximum");
for(int i=0;i<a.length;i++){
a[i]=scan.nextInt();
}
for (int i = 0; i < a.length; i++) {
while(a[i]>max){
max=a[i];
}
}
System.out.println("maximum number is= " + max);
}
}
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / g mohan kumar
import java.util.*;
class arrmax{
public static void main(String args[]){
int a[]=new int[10];
int max=0;
int temp;
Scanner s=new Scanner(System.in);
System.out.println("Enter 10 numbers to find out maximum");
for(int i=0;i<a.length;i++){
a[i]=s.nextInt();
}
for (int i = 0; i < a.length; i++) {
while(a[i]>max){
max=a[i];
}
}
System.out.println("this number is maximun number "+max);
}
}
| Is This Answer Correct ? | 0 Yes | 0 No |
main() { int i=1; while (i<=5) { printf("%d",i); if (i>2) goto here; i++; } } fun() { here: printf("PP"); }
what is oop?
main() { printf("\nab"); printf("\bsi"); printf("\rha"); }
What is full form of PEPSI
How can you relate the function with the structure? Explain with an appropriate example.
#include<stdio.h> main() { const int i=4; float j; j = ++i; printf("%d %f", i,++j); }
Ramesh’s basic salary is input through the keyboard. His dearness allowance is 40% of basic salary, and house rent allowance is 20% of basic salary. Write a program to calculate his gross salary.
main() { int i = 3; for (;i++=0;) printf(ā%dā,i); }
write a program to Insert in a sorted list
C statement to copy a string without using loop and library function..
main() { int a[10]; printf("%d",*a+1-*a+3); }
{ int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }