I am using a very simple code for subroutine but it is not printing right values. Please help me in this. My code is:
#include<stdlib.h>
#include<stdio.h>
main(){
int i, a, b=0.0, c=0.0;
void sum(int a , int b);
for ( i = 0; i < 2; i++ ) {
sum (a, b); c = c+b;
}
printf("%d\n", c);
}
void sum(int a , int b){
int i;
for ( i = 0; i <6; i++ ) {a = i*i;b = b+a;}
}