TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
SUNIL GUTTA
NA
1k
394.2k
printing prime numbers sequence ??
Jul 13 2013 12:09 PM
Hie
Please do check what wrong in my code i hope everything right .. but on console its just displaying one single value o/p i.e 13 .. after i press enter key its displaying next prime upon each pres .. y it is going n like this ...
using System;
using System.Collections.Generic;
using System. Linq;
using System.Text;
namespace ConsoleApplication2
{
class Program
{
static void Main()
{
for (int i = 3; i < 50;i++ )
{
if (i % 2 == 0)
continue ;
if (i % 3 == 0)
continue;
if (i % 5 == 0)
continue;
if (i % 7 == 0)
continue;
if (i % 11 == 0)
continue;
Console.WriteLine(i);
}
}
}
}
Reply
Answers (
6
)
Object data type
PDF Issues...