Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Program to implement RamaKrishna
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { /* program prints from 1 to 100 and for multiples of 3, it prints 'Rama' and for multiples of five it prints 'Krishna' instead of numbers. For numbers which are multiples of both 3 and 5, it prints RamaKrishna. */ public static void Main(string[] args) { string str = ""; for (int i = 1; i < 101; i++) { if ((i % 3 == 0) && (i % 5 == 0)) str += "RamaKrishna" + "\n"; else if (i % 3 == 0) str += "Rama" + "\n"; else if (i % 5 == 0) str += "Krishna" + "\n"; else str += i.ToString() + "\n"; } Console.WriteLine(str); } } }
run
|
edit
|
history
|
help
0
sfdcsddxasdxsd
project euler 10, C#
Square Real Matrix
Ccc
Classes, properties, methods, ling begining
actions and tasks
Gradebook
C++
30272 Program Ex7_2 switch
Integers Array manipulation examples