A little question about c language

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 2K views
nenyan
Messages
67
Reaction score
0
#include <stdio.h>
#include <stdlib.h>
int main()
{ double a[10];
int i=0;
for(i=0;i<10;i++)
a=0.0;
for(i=0;i<10;i++)
printf("a[%d]=%e, "), i, a;}

The result is radom number. What's wrong with my code?
 
Physics news on Phys.org
ok,,,i found the error
 
D H said:
The problem is here:

Where is the closing parenthesis on the printf statement?

Thanks a lot