Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int intCounter; // define variable integer intCounter
- for (int x = 0; x <= arr.Length; x++) // Start for loop with x = 0 which will break the loop if x is less than or equal arr.Length (which means the size of array) and after each loop it will increase the value of x by 1
- {
- arr[x] = intGrades; // assign intGrades value to the array which key value will be x (for the first loop it will be arr[0] second loop it will be arr[1] and so on)
- arr[x] = Int32.Parse(Console.ReadLine()); // assign value to arr[x] reading the line given by user on console. It will convert the user input to integer.
- intCounter++; // increase intCounter by 1
- if (intGrades == -99) // check if intGrades is -99
- {
- intCounter--; // if intGrades is -99 then decrease intCounter by 1
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement