ALPHA PLUS BATCH 1st class problem

ALPHA PLUS BATCH 1st class problem

-Calculate the area of a circle

//find the area of circle

#include<iostream>
using namespace std;
int main(){
    int r;
    cout<<"enter the value of r"<<endl;
    cin>>r;
    cout<<"area of circle is :" <<3.14*r*r;
return 0;
}

-Find the greatest from two of two number

//greatest of two number 
#include <iostream>
using namespace std;
int main(){
    int a,b;
    cout<<"enter the value of a and b :"<<endl;
    cin>>a>>b;
    if (a>b)
    {
    cout<<"greatest number is :"<<a;

    }else{
        cout<<"greastest number is :"<<b;
    }

return 0;
}

-Print the even number b/w 9 and 100

//print the even number b/w 9 & 100


int main() {
    cout << "Even numbers between 9 and 100 are:" ;

   for (int i = 10; i <= 100; i+=2)
   {
    cout<<i<<endl;
   }
    return 0;
}

-Average from 25 exam score


//avrage from 25 exam score


int main() {
    int numScores = 25;
    double totalScore = 0.0;

    cout << "Enter 25 exam scores:" << endl;

    for (int i = 1; i <= numScores; i++) {
        double score;
        cout << "Enter score #" << i << ": ";
        cin >> score;

        totalScore += score;
    }

    double average = totalScore / numScores;

    cout << "The average score is: " << average << endl;

    return 0;
}