An applicant will be accepted to the Jedi Knight Military Academy if he is at le
ID: 3868240 • Letter: A
Question
Explanation / Answer
1)
#include <stdio.h>
int main(void) {
// your code goes here
int n;
printf("enter the number");
scanf("%d",&n);
if(n%2==0)
printf("The number %d is Even",n);
else
printf("The number is %d is Odd",n);
return 0;
}
Output:
Enter the number:30
The number 30 is even
2)
#include <stdio.h>
int main(void) {
// your code goes here
char w;
printf("enter the Word");
scanf("%c",&w);
if(w=='Y'||w=='y')
printf("Yes,Lets Do it");
else if(w=='N'|w=='n')
printf("No,I wont Do it");
else if(w=='M'|w=='m')
printf("May be I will");
else if(w=='S'||w=='s')
printf("Sure Dude");
return 0;
}
Output:
enter the Word:Y
Yes,Lets Do it
3)
#include <stdio.h>
int main(void) {
// your code goes here
int y;
printf("enter the Year");
scanf("%d",&y);
if(y%4==0)
printf("the year %d is Leap year",y);
else
printf("the year %d is not Leap year",y);
return 0;
}
output:
enter the Year:2004
the year 2004 is Leap year
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.