someone help me with this if statement, for some reason when the number i enter is 1, the program should end there, right? instead it goes and computes the else part also.Code:#include <stdio.h> main() { int num1; int sum=0; printf("enter a positive number: "); num1= getc(stdin); for (num1=0; num1<4; num1++) if (num1 == 1) printf("Message I, num1 is %d\n", num1); else sum=((num1-1) + 2*(num1-1)); printf("Message II, sum is %d\n", sum); return 0; }
edit:nvm