+ 1

Can anybody explain this program?

#include <stdio.h> #define LEN1 6 #define LEN2 6 int x[2*LEN1-1]={1,2,3,4,5,6,0,0,0,0,0}; int h[2*LEN1-1]={1,2,3,4,5,6,0,0,0,0,0}; int y[LEN1+LEN2-1]; int main() { int i=0,j; for(i=0;i<(LEN1+LEN2-1);i++) { y[i]=0; for(j=0;j<=i;j++) y[i]+=x[j]*h[i+j]; } for(i=0;i<(LEN1+LEN2-1);i++) printf("%d\n",y[i]); }

2nd Oct 2021, 12:17 PM
Lalitkumar Prajapat
Lalitkumar Prajapat - avatar
2 Respostas
+ 2
Take pen copy and do dry run put values one by one you will understood better
2nd Oct 2021, 12:36 PM
A S Raghuvanshi
A S Raghuvanshi - avatar