1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
patriot [66]
3 years ago
5

Write a program to display the roll number of students who have scored 100 in math. display appropriate message if none have sco

red 100 in math. assume 10 array elements. (Blue J)
Computers and Technology
1 answer:
SVEN [57.7K]3 years ago
5 0

Answer:

# include<iostream>

#include<conio.h>

using namespace std;

main()

{

int mathmarks[10];

int highestmarks = 100;

int check =0;

for(int i= 1; i<=10; i++)

{

cout<<"\nMarks of student "<<i<<"in maths =";

cin>>mathmarks[i];

}

for (int j= 1 ; j<=10; j++)

{

    if (mathmarks[j] == highestmarks)

    {

    check = 1;

    break;

    }

}

if (check = 1)

{

cout<<"The student having 100 marks in class having roll # ="<<j;

}

else

{

cout<<"No Student Have 100 Marks in Class";

}

getch();

}

Explanation:

In this program, we need to find the student who have got 100 marks and print his roll number. if no students have 100 marks then print "No students got 100 marks in class". So, we take and integer type array named mathmarks of size 10. Two integer variables named highestmarks to store 100 and check to check the condition in if else. Initially check = 0, if we found the student having 100 marks then this will be updated as 1 and we print our required output, else we print no student got 100 marks.

You might be interested in
What happens if you create multiple accounts just to get points faster?
balandron [24]
I don’t think it will work sadly. You can probably accumulate points though on your pre existing account. Hope that helps!
8 0
2 years ago
Given the following method definitions: void mystery(double a) { System.out.print("double! "); } void mystery(int a) { System.ou
kicyunya [14]

Answer:

The correct answer to the following question is option "b".  

Explanation:

The method having the same name but the arguments have different so it is called method overloading. It is a part of the object-oriented programming language (oops).  

  • In the given code we define same method two times that is "mystery()". but in this method, we pass two different parameters. For the first time, we pass a double variable that is "a" as a parameter. In the second time, we pass an integer variable that is "a" as a parameter and in both functions, we write some codes.
  • In the calling time, we call function two times. In first time calling we pass an integer value that is "1" and second time calling we pass double value that is "1.0". So the output of this code is "int! double!".  

That's why the option "b" is correct.

6 0
2 years ago
Are u a chicken nugget!!??
creativ13 [48]
Yes. Yes I would classify myself as the nugget of the chicken thank you for asking me. 
3 0
3 years ago
Read 2 more answers
Array Challenge Have the function ArrayChallenge (arr) take the array of numbers stored in arr and return the string true if any
vampirchik [111]

Answer:

The code is given as follows,

Explanation:

Code:

#include <stdio.h>

#include <string.h>  

int n; //to store size of array  

char* ArrayChallenge(int arr[]) //function returns string true or false

{

  int i, j;

  int sum = 0;

  for(i = 0; i < n; i++)

  {

      sum = sum + arr[i]; //count sum

  }  

  for(i = 0; i < n; i++)

  {

      for(j = i+1; j < n; j++) //loop for every two elements in array

      {

          if(arr[i]*arr[j] > 2*sum) //check if proudct of two elements > 2 times sum

          {

              printf("\n%d x %d = %d, 2xSum = %d\n", arr[i], arr[j], arr[i]*arr[j], 2*sum);

              return "true"; //If proudct of two elements > 2 times sum. return true

          }

      }

  }

  return "false"; // If proudct of two elements < 2 times sum. return false

}  

int main()

{  

  printf("\nEnter size of array: ");

  scanf("%d", &n); //read size of array

  int A[n]; //array of size n

  printf("\nEnter array elements: ");

  int i;

  for(i = 0; i < n; i++)

  {

      scanf("%d", &A[i]); //read array from stdin

  }

  printf("%s\n",ArrayChallenge(A)); //ccall function and print answer

 

  return 0;

}

6 0
3 years ago
Write a program that prints the U.S. presidential election years from 1792 to present day, knowing that such elections occur eve
Naddika [18.5K]
Year = 1972
current year = 2021

while year <= current year:
print (year)
year = year + 4
8 0
2 years ago
Other questions:
  • An electronic resume is a plain-looking document. True of False?
    6·2 answers
  • A word or line of a paragraph at the top of a page hanging indent is called ______
    8·1 answer
  • Software that instructs the computer how to run applications and controls the display/keyboard is know as the
    8·1 answer
  • What is a good way to minimize technical problems with your computer
    10·1 answer
  • Using a caesar cypher with an offset of three characters (a -&gt; d, b -&gt;e, ...., z -&gt; c), what would be the correct cyphe
    6·1 answer
  • Which property is assigned to a file by the operating system?
    13·1 answer
  • Ad identifies and describes at least four ways to prevent downloading of spyware, adware, and viruses to computer
    9·1 answer
  • Agent Phil Coulson developed this program to register Avengers in S.H.I.E.L.D's database using cutting-edge programming language
    15·1 answer
  • define the term computer hardware and its various types mentioning 5 examples of IP or devices with one diagram each​
    9·1 answer
  • Using programming libraries is one way of incorporating existing code into new programs.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!