Print numbers between 1 and 100 which are except divisible by 3 or 5 in C#.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 | static void Main(string[] args) { for(int i=1;i<=100;i++) { if(i%3!=0 || i%5!=0) { Console.Write(i+" "); } } Console.ReadKey(); } |
Output:
You can find more similar examples of programming for this programming language in the site.