Anonymous
Thank you guys
Anonymous
I dont understand how this program works. We didnt declared anything for getchar, how does it works ? What does the empty loop do ?
Anonymous
Could someone explain please :(
Anonymous
found a backdoor on my computer should i kill myself.whois record belong arin.net
Anonymous
I dont understand how this program works. We didnt declared anything for getchar, how does it works ? What does the empty loop do ?
We input first and last name separated by a space, the first character of the first name is assigned to initial and then the while loop iterates the getchar through the characters until a space is encountered, that is in case here, our last name.
Anonymous
The second while loop prints the last name character by character and then the last printf is executed
Anonymous
Thank you so much !
Talula
Cant we use '\t' for some tab ?
I haven't tried it, last used scanf back in 1400 BC or something
Bruce
What does %.2f means,I know %f means float specifier,but what does the numerical value and the point means?plz any one clarify this
Liam
Thanks,👍
https://en.wikipedia.org/wiki/Printf_format_string#Precision_field
Anonymous
i believe \w matches any whitespace
Anonymous
could be wrong
Bruce
The above is to find average In this I have a doubt,in the first line Mark[10] is used ,why mark has size 10 what if number n<10 or more than 10 is given as input
Liam
For this snippet of code: when `n < 0` output is 0; when `n == 0` divided by zero error will be raise: when `0 < n <= 10`, despite risk of overflow, it works correctly; when `n > 10`, segmentation fault caused by index out of range might be raised.
Liam
Practically speaking, only for finding average, recoding these input in an array is useless.
Bruce
Practically speaking, only for finding average, recoding these input in an array is useless.
Actually I am now studying arrays,the example is given so I have doubt in it
Liam
It shows how to store data into and load data from an array...… but for the intention of the code, hmmmm……
Anonymous
Hi
Bruce
Or less than 10 also possible
Anonymous
Ya less than 10 also
Bruce
Kk,thanks
Anonymous
It mean it we can store less than or equal to 10 bt we cant store more than 10 values
Anonymous
Hello guys
Anonymous
Some dude from iran who cant join sent me the link so you can add him
Anonymous
For some reason iran is banned of joining
Dima
Anonymous
He’s called OM
Mat
The above is to find average In this I have a doubt,in the first line Mark[10] is used ,why mark has size 10 what if number n<10 or more than 10 is given as input
You can ask for n, then allocate the array. If you want do it in advance you need to initialize it w/ an upper bound that you need to control when you ask for n (something like n max is 10)
Param Veer
Yes
Param Veer
Ok
Param Veer
You should practice more
Param Veer
Nice work
Param Veer
I Appreciate
Mat
Arrays are useful when you need to store multiple values :) and it's not that case imho
Bruce
I am not getting output,can any one say what wrong I have done
Mat
Give us the instance
Bruce
Give us the instance
To find average
Dima
probably because resulting avg should be float
Param Veer
Yes
Param Veer
Type %f
Mat
To find average
I mean, which is the input and what is the output
Param Veer
Yes pavan please tell
Mat
To find average
That's the purpose
Bruce
I mean, which is the input and what is the output
I mean,I am getting an error message
Mat
I mean,I am getting an error message
That's TOTALLY different from getting no output
Bruce
Once check the programme
Bruce
Mat
/saved
Bruce
Getting what?
Error message
Mat
Error message
#howtoask
Liam
I mean,I am getting an error message
hmmm, so, what's the error msg you've got?
Liam
#howtoask
nice shot.
Mat
Error message
Start from point one telling us which problem do you have
Dima
What the heck man
Mat
As @LiamHuang suggests
Liam
hmmm, in the for loop, you should code something like: for (i = 0; i < n; ++i). It's semicolon, not comma.
Dima
Lol the error clearly says that
Bruce
Lol the error clearly says that
I can't understand what it said,I am just beganer in this
Param Veer
Dima
Never insult anyone
That’s clearly not insult