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() { struct date; struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }
what is oop?
Predict the Output: int main() { int *p=(int *)2000; scanf("%d",2000); printf("%d",*p); return 0; } if input is 20 ,what will be print
How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”) d. printf(“\%%”)
Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?
main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above
void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %d\n",++i); }
what is the code of the output of print the 10 fibonacci number series
pls anyone can help me to write a code to print the values in words for any value.Example:1034 to print as "one thousand and thirty four only"
main() { extern i; printf("%d\n",i); { int i=20; printf("%d\n",i); } }
Is it possible to print a name without using commas, double quotes,semi-colons?
C statement to copy a string without using loop and library function..