my project has diffrent result every time [closed] - c

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I wrote this code in my project but every time i run it the answer is diffrent.
]1

Initialize sum with a value of 0. The reason it is different every time is you are calling sum which you never assigned a value. Anything could be in memory where sum is stored, which is why your results are inconsistent.

Related

Address fields to combine with comma , with null check [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 days ago.
Improve this question
Trying to add address fields with comma at the end of the field , but if any one of the field is missing i am getting multiple comma's

How to make sparse array c language without condition I !=o? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 days ago.
Improve this question
How to make sparse array c language without condition i !=0 ??
I tried i!=0 condition but teacher doesn't want that
Teacher wants another path ??

How to remove point from float type in C? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I've the following number: 14.2423421. This number is a float. I want to convert it into 142423421. So, I want the same number, without the point. It has to be an int. Obviously it mustn't be a string type. How to do it? Thank you everybody!
Count the number of decimals as suggested here and multiply your number by 10^(number of decimals)

Can anyone translate this into python? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
dow(m,d,y) {
y-=m<3;
return(y+y/4-y/100+y/400+"-bed=pen+mad."[m]+d)%7;
}
The function's purpose is to find what day(Su-Sa) will the provided date(1-31) land on in any given month and year.
I'm not sure how this function works because it was written in C. Mostly I don't know what
the y-=m<3 is for, or what the "-bed=pen+mad." does (is this just a string?).
here is my source: https://cs.uwaterloo.ca/~alopez-o/math-faq/node73.html
Just use the python datetime module:
import datetime
dayOfWeek = datetime.datetime(y, m, d).weekday()
dayOfWeek will then be an integer between 0 and 6 corresponding to Monday - Sunday.
Have a look at the docs for more details.

User input to an array [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
When using C programming language, I have no idea how to put a user input to an array.
I need to get integers from the user in from of:
printf("Enter numbers. Separate each by a comma: ");
How can I put each number into an array?
This is a very helpful link
Also look up this too for clarification on Console.Read & Console.Readline
Difference between Console.Read() and Console.ReadLine()?

Resources