You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sum+=(1/i); //Note: 1/i --> int/float will give the answer in float(sum). If i is int, then the program hangs
i=i+1;
}
printf("%d card(s)\n",(int)(i-2)); //If typecasting to int not done then %d prints 0. %f prints the answer in float(3.000000). Typecasting to int gives 3