Not able to calculate in C.How do you calculate in C?
Your main issue is that you declare all your variables as ints, but smp2 and total must hold floating point values. Change your declarations to int smp1; double smp2, total; unsigned int smp3; This way, the types of the variables match up with the conversion specifiers used in the printf and scanf calls. Types matter … Read more