calculate and display the square root of each value in NumArray then store it in an array called SquareNumArray.
hi guys what is wrong with this code?
#include <stdio.h>
int main()
{
int numArrays[] = {2, 67, 23, 5, 7, 34, 14, 4, 8, 62};
int SqareNumArray[];
int i;
for(i=0; i<10; i++)
{
SquareNumArray[i]=sqrt(numArrays[i]);
printf("%d", SquareNumArray[i]);
}
}
juljan30
0
Newbie Poster
Recommended Answers
Jump to PostAccording to my compiler the following things are wrong with your code:
bla.c: In function 'main':
bla.c:5:5: error: array size missing in 'SqareNumArray'
bla.c:9:1: error: 'SquareNumArray' undeclared (first use in this function)
bla.c:9:1: note: each undeclared identifier is reported only once for each function it appears in
bla.c:9:1: warning: …
Jump to PostWhen asking for help, EXPLAIN what problem you are having. Do not expect us to try to figure out what it does wrong -- tell us!
All 6 Replies
sepp2k
378
Practically a Master Poster
juljan30
0
Newbie Poster
mosaad
0
Newbie Poster
juljan30
0
Newbie Poster
mosaad
0
Newbie Poster
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.