Answer:
# include <iostream>
#include<stdio.h>
using namespace std;
bool IsLeapYear(int y)
int main()
{
int y;
cout<<"Enter the Year to check Leap or Not"<<endl;
cin>>y;
IsLeapYear(int y);
getch();
}
bool IsLeapYear(int y)
{
if (y%4==0)
{
if (y%100==0)
{
if (y%400==0 )
{
cout<"The year is leap Year";
}
else
{
cout<<" The year is not Leap Year";
}
}
else
{
cout<<"The year is Leap Year" ;
}
}
else
{
cout<<"The year is not Leap Year";
}
}
Explanation:
In this program a function has been defined named as IfLeapYear, to check that whether the entered year is leap year or not. An year taken as integer data type named as y to enter the year to check. If the year is divisible by 4 but not divisible by 100 is the leap year. If the year is divisible by 4, divisible by 100 and also divisible by 400 is the century year and is also the leap year.
To check all the statements, Nested if-else conditions has been used to check multiple requirements of the leap year.
Answer:
a local or restricted communications network, especially a private network created using World Wide Web software.
Explanation:
Answer:
Reflection on what though?
Explanation:
Answer:
formula bar shows the contents of the current cell and allows you to create and view the formulas
Answer:
Explanation:
The following is written in Java. It creates the function num_eights and uses recursion to check how many times the digit 8 appears in the number passed as an argument. A test case has been created in the main method and the output can be seen in the image below highlighted in red.
public static int num_eights(int pos){
if (pos == 0)
return 0;
if (pos % 10 == 8)
return 1 + num_eights(pos / 10);
else
return num_eights(pos / 10);
}