Docsity

Create c# program Using Control Structure, Exercises of Javascript programming

Toggle sidebar
bg1
Learn Python
C# Online Compiler
Main.cs Output
// Online C# Editor for free
// Write, Edit and Run your C# code using C#
Online Compiler
//Rivas, Joy B.
//BSIT III-2
//Write a program that prints on the console
the numbers from 1 to N, which are not
divisible by 3 and 7 simultaneously. The
number N should be read from the standard
input.
using System;
public class HelloWorld
{
public static void Main(string[] args)
{
Console.Write("Enter the value of N: "
);
int N = int.Parse(Console.ReadLine());
for (int j = 0; j <= N; j++)
if (j % 3 != 0 && j % 7 != 0)
Console.WriteLine(j);
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Run

Partial preview of the text

Download Create c# program Using Control Structure and more Exercises Javascript programming in PDF only on Docsity!

Learn Python C# Online Compiler

Main.cs Output

// Online C# Editor for free // Write, Edit and Run your C# code using C# Online Compiler

//Rivas, Joy B. //BSIT III- //Write a program that prints on the console the numbers from 1 to N, which are not divisible by 3 and 7 simultaneously. The number N should be read from the standard input.

using System;

public class HelloWorld { public static void Main(string[] args) { Console.Write("Enter the value of N: " ); int N = int.Parse(Console.ReadLine());

for (int j = 0; j <= N; j++) if (j % 3 != 0 && j % 7 != 0) Console.WriteLine(j); } }

Run