You are on page 1of 1

#include <16f84.

h>
#byte portb =0x06
#byte porta =0x05
void main (void)
{
int a,b;
set_tris_a(0xff);
set_tris_b(0x00);
a=input_A();
b=a;
if (b==0)
output_b(1);
else {
while(b!=1)
{
b=b-1;
a=a*b;
}
}
output_b(a);
}

You might also like