A little question about c language

  • Thread starter nenyan
  • Start date
  • #1
67
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?
 

Answers and Replies

  • #2
D H
Staff Emeritus
Science Advisor
Insights Author
15,393
685
The result is radom number. What's wrong with my code?

The problem is here:
printf("a[%d]=%e, "), i, a;


Where is the closing parenthesis on the printf statement?
 
  • #3
67
0
ok,,,i found the error
 
  • #4
67
0
The problem is here:

Where is the closing parenthesis on the printf statement?
Thanks a lot
 

Related Threads on A little question about c language

Replies
3
Views
1K
  • Last Post
Replies
4
Views
3K
Replies
5
Views
2K
  • Last Post
Replies
7
Views
4K
  • Last Post
Replies
5
Views
3K
  • Last Post
Replies
3
Views
2K
  • Last Post
Replies
7
Views
2K
  • Last Post
Replies
3
Views
2K
Top