Computer Science, asked by taniya55555, 1 year ago

(1) write a programme to input a year and check whether it's a leap year or not ??
(2) write a programme to input the marks of three subjects and find the percentage and check whether the students have passed it not??

Only need the Input. please help me fast. I need this assignment tommorow only..

NO SLAMMING...!!!!


taniya55555: good
rakeshmohata: Happy to hear that!!
taniya55555: ya... how's u
rakeshmohata: fine!!
taniya55555: ok
rakeshmohata: hmm
taniya55555: coke to that... talk there
rakeshmohata: ??
taniya55555: come to that question.... don't talk here
rakeshmohata: Ok ..

Answers

Answered by Anonymous
1
leap yearp
#include <stdio.h>
int main()
{ int year;
printf("Enter a year: "); scanf("%d",&year); if(year%4 == 0) { if( year%100 == 0) { // year is divisible by 400, hence the year is a leap year
if ( year%400 == 0)
printf("%d is a leap year.", year);
else printf("%d is not a leap year.", year); }
else printf("%d is a leap year.", year ); }
else printf("%d is not a leap year.", year);
return 0;
2nd
#include <stdio.h>
int main(void){
int num;
printf("Enter your mark ");
scanf("%d",&num);
printf(" You entered %d", num); // printing outputs

if(num >= 80){
printf(" You got A grade"); // printing outputs
}
else if ( num >=60){ // Note the space between else & if
printf(" You got B grade");
}
else if ( num >=40){
printf(" You got C grade");
}

else if ( num < 40){
printf(" You Failed in this exam");
}
return 0;
}

rakeshmohata: anymore help?
rakeshmohata: proud to help u!!
taniya55555: If I go into any cyber cafe... can't they do that??
taniya55555: which cable I need??
rakeshmohata: yeah they can..
taniya55555: ok then thanks
taniya55555: I will go there tomorrow only
rakeshmohata: just go in a cyber cafe.. login ur email download and print the file.. and logout
rakeshmohata: proud to help u
taniya55555: ok
Similar questions