0

HELP PLEASE

#include<stdio.h> void main() { int n=25,i=1; float sum; for( i=1;i<=n;i++) { sum=sum+(1/i); } printf("%.2f",sum); } whatever might be n value, its giving 1 as the output all the time. please help.

25th Dec 2017, 4:45 PM
Shiva Kandagatla
Shiva Kandagatla - avatar
2 Answers
+ 1
THANK YOU KURWIUS
25th Dec 2017, 5:02 PM
Shiva Kandagatla
Shiva Kandagatla - avatar