Hi guys . i was working on given below question. and i try to solve it. can any one confirm it that is this correct solution for that question? if not then can u tell me whats the right code. Fix it if its not correct and also tell me reason thx
Much appreciate that
Exercise:
Create a MikroC program to read in an 8-bit unsigned number on PORTB. If the number is even AND divisible by 3, PORTC.F0 = 1. Otherwise PORTC.F0 = 0.
Solution
Code:void main(){ ADCON1=7; TRISB=0b11111111; TRISC=0; while (1) { else if (PORTB%3==0){PORTC.F0=1;} else {PORTC.F0=0;} } }