i want to print total of 3 numbers using array. i trie but sum is print as zero. tell me whats wrong in the code
Code:#include <stdio.h>main() { int n,i; float a[100],sum=0; for(i=0;i<3;i++) { printf("Enter 3 no to find total "); scanf("%d",&a[i]); sum=sum+a[i]; } printf("total is %d",sum); }