Find the highest (maximum) and lowest (minimum) grades in an array of 25 integer grades. Print the array and print the highest and lowest grades, labeled appropriately

Task:  Find the highest (maximum) and lowest (minimum) grades in an array of 25 integer grades.  Print the array and print the highest and lowest grades, labeled appropriately. Try to enter all kind of integer grades in your array.

Hits of integer grades:

A+ is a Letter Grade.
A is  a Letter Grade.
4 is an Integer Grade.
3.75 is an Integer Grade.
So we may assume that 'A+' = 4, A = 3.75 etc.

Source Code

#include<stdio.h>
#include<conio.h>
void grade(float grades[],int size)
{
float min=0,max=0;
int i;
for(i=0;imax)
{
max=grades[i];
}
}

for(i=0;i<size;i++)
{
if(grades[i]<min)
{
min=grades[i];
}
}
printf("\n");
printf("Maximum Grade: %.2f",max);
printf("\n");
printf("Minimum Grade: %.2f",min);
}
int main()
{
float grades[25],size;
printf("Enter the size of an Array:\n");
scanf("%f",&size);
printf("Enter the Grade point:\n");
grade(grades,size);
return 0;
}
<< Go to Index Page >>

20 মন্তব্যসমূহ

  1. #include
    #include
    #include
    void grade(float grades[],int size)
    {
    float min=0,max=0;
    int i;
    for(i=0;imax)
    {
    max=grades[i];
    }
    }

    for(i=0;i<size;i++)
    {
    if(grades[i]<min)
    {
    min=grades[i];
    }
    }
    printf("\n");
    printf("Maximum Grade: %.2f",max);
    printf("\n");
    printf("Minimum Grade: %.2f",min);
    }
    int main()
    {
    float grades[25],size;
    printf("Enter the size of an Array:\n");
    scanf("%f",&size);
    printf("Enter the Grade point:\n");
    grade(grades,size);
    return 0;
    }

    উত্তরমুছুন
  2. using C++
    #include

    using namespace std;

    int main()
    {
    int arr[25], i, temp, j;
    for(i = 0; i < 5; i++){
    cout << "Enter " << i+1 << " data --: ";
    cin >> arr[i];
    }

    cout << "You entered data is bellow --: \n";
    for (i = 0; i < 5; i++){
    cout << i+1 << " data is --:";
    cout << arr[i] << "\n";
    }
    cout << "\n";
    for (j = 0; j < 4; j++){
    for (i = 0; i < 4; i++){
    if (arr[i] > arr[j+1]){
    temp = arr[i];
    arr[i] = arr[j+1];
    arr[j+1] = temp;
    }
    }
    }
    cout << "\n";

    cout << "Array in sorted bellow --:\n";

    for (i = 0; i < 5; i++){
    cout << "Data " << i+1 << " is --: ";
    cout << arr[i];
    cout << "\n";
    }

    cout << "\n" << "The minimum value is --: " << arr[0] << "\n";
    cout << "\n" << "The maximum value is --: " << arr[4] << "\n";

    return 0;

    }

    উত্তরমুছুন
  3. using C++
    #include

    using namespace std;

    int main()
    {
    int arr[25], i, temp, j;
    for(i = 0; i < 5; i++){
    cout << "Enter " << i+1 << " data --: ";
    cin >> arr[i];
    }

    cout << "You entered data is bellow --: \n";
    for (i = 0; i < 5; i++){
    cout << i+1 << " data is --:";
    cout << arr[i] << "\n";
    }
    cout << "\n";
    for (j = 0; j < 4; j++){
    for (i = 0; i < 4; i++){
    if (arr[i] > arr[j+1]){
    temp = arr[i];
    arr[i] = arr[j+1];
    arr[j+1] = temp;
    }
    }
    }
    cout << "\n";

    cout << "Array in sorted bellow --:\n";

    for (i = 0; i < 5; i++){
    cout << "Data " << i+1 << " is --: ";
    cout << arr[i];
    cout << "\n";
    }

    cout << "\n" << "The minimum value is --: " << arr[0] << "\n";
    cout << "\n" << "The maximum value is --: " << arr[4] << "\n";

    return 0;

    }

    উত্তরমুছুন
  4. #include
    using namespace std;

    int main(){
    float arr[20], value, temp;
    int period,i,j;

    cout<<"How many students : ";
    cin>>period;

    cout<<"Enter the grades : ";
    for(i=0; i>arr[i];
    }

    for(i=0; iarr[j+1]){
    temp=arr[j];
    arr[j]=arr[j+1];
    arr[j+1]=temp;

    }
    }
    }

    for(i=0; i<period; i++){
    cout<<arr[i];
    }

    cout<<endl<<"maximum grade is: "<<arr[period-1];
    cout<<endl<<"minimum grade is: "<<arr[0];


    return 0;
    }

    উত্তরমুছুন
  5. #include
    using namespace std;
    int main()
    {
    float temp,s;
    int i,j;
    cout<<"How many Student: ";
    cin>>s;
    float a[40];
    cout<<"Input"<< s <<"students grade: ";
    for(i=0; i>a[i];
    for (i=0; i<(s-1); i++)
    {
    for (j=0; ja[j+1])
    {
    temp= a[j];
    a[j]= a[j+1];
    a[j+1]=temp;
    }
    }
    }


    cout<<a[40-1]<<endl;
    cout<<a[0];
    }

    উত্তরমুছুন
  6. Appel mahmud akib. Id:201510384


    #include
    using namespace std;
    int main()
    {
    float temp;
    int i,j,s;
    cout<<"How many Student: ";
    cin>>s;
    float a[s];
    cout<>a[i];
    for (i=0; i<(s-1); i++)
    {
    for (j=0; ja[j+1])
    {
    temp= a[j];
    a[j]= a[j+1];
    a[j+1]=temp;
    }
    }
    }

    cout<<endl<<a[s-1]<<endl;
    cout<<a[0]<<endl;
    }

    উত্তরমুছুন
  7. #include
    using namespace std;
    int main()
    {
    float temp;
    int i,j,s;
    cout<<"How many Student: ";
    cin>>s;
    float a[s];
    cout<<"Input"<>a[i];
    for (i=0; i<(s-1); i++)
    {
    for (j=0; ja[j+1])
    {
    temp= a[j];
    a[j]= a[j+1];
    a[j+1]=temp;
    }
    }
    }

    cout<<endl<<a[s-1]<<endl;
    cout<<a[0]<<endl;
    }

    উত্তরমুছুন
  8. #include

    using namespace std;

    int main()
    {
    int arr[25], i, temp, j;
    for(i = 0; i < 5; i++){
    cout << "Enter " << i+1 << " data --: ";
    cin >> arr[i];
    }

    cout << "You entered data is bellow --:";
    for (i = 0; i < 5; i++){
    cout << i+1 << " data is --:";
    cout << arr[i] << "\n";
    }
    cout << "\n";
    for (j = 0; j < 4; j++){
    for (i = 0; i < 4; i++){
    if (arr[i] > arr[j+1]){
    temp = arr[i];
    arr[i] = arr[j+1];
    arr[j+1] = temp;
    }
    }
    }
    cout << "\n";

    cout << "Array in sorted bellow --:\n";

    for (i = 0; i < 5; i++){
    cout << "Data " << i+1 << " is --: ";
    cout << arr[i];
    cout << "\n";
    }


    return 0;

    }

    উত্তরমুছুন
  9. Using C++
    Mamun ID 149
    #include

    using namespace std;

    int main()
    {
    int arr[25], i,j,p;
    for(i = 0; i < 5; i++){
    cout << "Enter your deserve number : " << " data --: ";
    cin >> arr[i];
    }

    cout < arr[j+1]){
    p = arr[i];
    arr[i] = arr[j+1];
    arr[j+1] = p;
    }
    }
    }
    cout <<endl;

    cout << "Array in sorted bellow --:"<<endl;

    for (i = 0; i < 5; i++){
    cout << "Data " << i+1 << " is --: ";
    cout << arr[i];
    cout <<endl;
    }


    return 0;

    }

    উত্তরমুছুন
  10. using c++

    #include
    using namespace std;
    int main()
    {
    float temp;
    int i,j,s;
    cout<<"How many Student: ";
    cin>>s;
    float a[s];
    cout<<"Input"<>a[i];
    for (i=0; i<(s-1); i++)
    {
    for (j=0; ja[j+1])
    {
    temp= a[j];
    a[j]= a[j+1];
    a[j+1]=temp;
    }
    }
    }

    cout<<endl<<a[s-1]<<endl;
    cout<<a[0]<<endl;
    }

    উত্তরমুছুন
  11. #include
    using namespace std;

    int main()
    {
    int arr[25],i,j,temp;

    for(i=0; i<5; i++){
    cout <<"Enter "<>arr[i];
    }
    for(j=0; j<4; j++){
    for(i=0; i<4; i++){
    if (arr[i]>arr[j+1]){
    temp=arr[i];
    arr[i]=arr[j+1];
    arr[j+1]=temp;
    }
    }
    }
    cout <<"Array in sorted bellow: "<< endl;

    for(i=0; i<5; i++){
    cout <<"Data "<< i+1<< " is: "<<arr[i]<< endl;

    }
    cout <<"The minimum value is: "<<arr[0]<<"\n";
    cout <<"The maximum value is: "<<arr[4];

    return 0;
    }
    id:201510992

    উত্তরমুছুন
  12. // biggest and smallest number

    #include

    using namespace std;

    int main ()
    {

    int values[ 20 ];
    int small,big;
    for ( int i = 0; i < 20; i++ )
    {
    cout << "Enter value " << i << ": ";
    cin >> values[i];
    }
    for (int i = 0; i < 20; i++)
    {
    if(values[i]>big)
    {
    big=values[i];
    }
    if(values[i]<small)
    {
    small=values[i];
    }
    }
    cout << "The biggest number is " << big << endl;
    cout << "The smallest number is " << small << endl;
    }

    উত্তরমুছুন
  13. Summer 2017
    ID#201610042

    Answer to the Question No. 3:
    https://drive.google.com/file/d/0B99eePh0LV8gRHBuRkk2YjkwT28/view?usp=drivesdk

    উত্তরমুছুন
  14. ID : 201620195
    https://drive.google.com/open?id=0B9K31ospCyFjZXROSWtYMDdrQ0k

    উত্তরমুছুন
  15. ID 201610456
    MD USUF MIA
    https://drive.google.com/open?id=0B_PIGnOMR0K2cXZ2bjBnMTJNTFE

    উত্তরমুছুন
  16. ID:201520552
    https://drive.google.com/open?id=0B5pG0kIjzgEKdWR6ckJTbUtQdVE

    উত্তরমুছুন
  17. ID 201610456
    MD USUF MIA
    https://drive.google.com/open?id=0B_PIGnOMR0K2cXZ2bjBnMTJNTFE

    উত্তরমুছুন
  18. https://drive.google.com/open?id=0Byxq3aat_mNSeTRTY1JzZFJLUlU

    উত্তরমুছুন
  19. https://www.dropbox.com/s/7x0km7ftcdvp2tj/maximum.cpp?dl=0

    Robiul islam
    Id 201711203
    sec A

    উত্তরমুছুন
  20. https://drive.google.com/open?id=0B2Kd5YiufNdVdmI4VFE5c3p4Sm8

    উত্তরমুছুন
নবীনতর পূর্বতন