Advertisement
tapan29bd

Debi Project 1

Nov 29th, 2015
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.77 KB | None | 0 0
  1. int intCounter; // define variable integer intCounter
  2. 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
  3. {
  4.   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)
  5.   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.
  6.   intCounter++; // increase intCounter by 1
  7.  
  8.   if (intGrades == -99) // check if intGrades is -99
  9.   {
  10.     intCounter--; // if intGrades is -99 then decrease intCounter by 1
  11.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement