Skip to content

13-CSharpExercises-VisualStudio #122

@ytlitng

Description

@ytlitng
  1. Where can I find your repository? (Paste the url of your repository below)
    https://github.com/ytlitng/CSharpExercises

  2. Which data type would you use to store a phone number?
    int ?

  3. Surprise! Write a for loop to write out all even numbers between 1 and 100 to the console in both JavaScript and C#.

// your javascript code here

for(int i=1; i <= limit; i++){
if( i % 2 == 0){
System.out.print(i + " ");
}
}

// your c# code here

for(counter = 1; counter <= 100; counter++) {

    if(counter%2 == 0) { 
        /* counter is even, print it */
        printf("%d ", counter);  
    }  
}  

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions