1.

(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...!!!!

Answer»

Leap yearp
#include
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
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;
}



Discussion

No Comment Found