Answer:#include <stdio.h>
int main() {
int num;
printf("Enter an integer: ");
scanf("%d", &num);
// true if num is perfectly divisible by 2
if(num % 2 == 0)
printf("%d is even.", num);
else
printf("%d is odd.", num);
return 0;
}
Answer:
Explanation:
Part a)
_______________ ____________ _____________ ___
TAR | /\ \/ /\ \/ /\
|//////////|____________|____________|_____________|__________|
0 600 800 600 800 600
PWM Duty Cycle = 200/800 = 25%
Part b)
______________ _________________ _________ _________________
TAR | \/ /\ \/ /\ \/
|//////////|_________|_________________|__________| _______________|
0 600 800 600 800 600
PWM Duty Cycle = 600/800 = 75%