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 = 257; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }
void func1(int (*a)[10]) { printf("Ok it works"); } void func2(int a[][10]) { printf("Will this work?"); } main() { int a[10][10]; func1(a); func2(a); } a. Ok it works b. Will this work? c. Ok it worksWill this work? d. None of the above
Code for 1>"ascii to string" 2>"string to ascii"
1 Answers Aricent, Global Logic,
How can you relate the function with the structure? Explain with an appropriate example.
main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }
29 Answers IBM, TCS, UGC NET, Wipro,
Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines
main() { int i=-1; +i; printf("i = %d, +i = %d \n",i,+i); }
How we print the table of 3 using for loop in c programing?
What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?
1 o 1 1 0 1 0 1 0 1 1 0 1 0 1 how to design this function format in c-language ?
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.
#define a 10 int main() { printf("%d..",a); foo(); printf("%d..",a); return 0; } void foo() { #undef a #define a 50 }