Computer Science, asked by MansiSolanki9621, 1 year ago

Write an algorithm and flow chart and programme to check leap year in c

Answers

Answered by azalkhan722
10

Answer:

yes

Explanation:

above one is true mark him brainliest because he dese

rves.

Answered by syed2020ashaels
0

Answer:

Given below is the alogrithm and the explaination

Explanation:

A leap year, with the exception of century years, is exactly divisible by 4. (years ending with 00). Only if the century year is exactly divisible by 400 is it a leap year.

For instance,

Not a leap year, 1999

A leap year, 2000

As a leap year, 2004

#include <stdio.h>

int main() {

  int year;

  printf("Enter a year: ");

  scanf("%d", &year);

  // leap year if perfectly divisible by 400

  if (year % 400 == 0) {

     printf("%d is a leap year.", year);

  }

  // not a leap year if divisible by 100

  // but not divisible by 400

  else if (year % 100 == 0) {

     printf("%d is not a leap year.", year);

  }

  // leap year if not divisible by 100

  // but divisible by 4

  else if (year % 4 == 0) {

     printf("%d is a leap year.", year);

  }

  // all other years are not leap years

  else {

     printf("%d is not a leap year.", year);

  }

  return 0;

}

See more:

https://brainly.in/question/16566309

#SPJ3

Similar questions