ok ive wrote an example program to help me with a project but its not working.
basically,the user has to enter the number "1".after this is done my program SHOULD display the amount of times it has been entered correctly,and incorrectly.(the answer to each of these answers will either be 1 or zero,no loop)
but the problem is,even when i enter it incorrectly,it says i have entered it correctly once,which i havent!
Code:
#include <stdio.h>
main()
{
int crt, incrt, num;
incrt=0 ;
crt=0 ;
num = 1 ;
printf("please enter the num 1\n") ;
scanf("%d",&num) ;
if (num=1)
{
printf("Correct!!") ;
crt++ ;
}//end if crt
else if (num != 1)
{
printf("Incorrect!!") ;
incrt++ ;
}//end if incrt
printf("Incorrectly entered = %d",incrt) ;
printf("Correctly entered = %d",crt) ;
}//end main
any help at all will be much appreciated!