Click here to Skip to main content
14,365,158 members

ATL / WTL / STL

 
AnswerRe: Time of reading text file Pin
econy11-Nov-14 3:06
memberecony11-Nov-14 3:06 
GeneralRe: Time of reading text file Pin
Richard MacCutchan11-Nov-14 6:42
protectorRichard MacCutchan11-Nov-14 6:42 
GeneralRe: Time of reading text file Pin
econy11-Nov-14 7:56
memberecony11-Nov-14 7:56 
GeneralRe: Time of reading text file Pin
Richard MacCutchan11-Nov-14 8:05
protectorRichard MacCutchan11-Nov-14 8:05 
GeneralRe: Time of reading text file Pin
econy11-Nov-14 8:17
memberecony11-Nov-14 8:17 
GeneralRe: Time of reading text file Pin
Richard MacCutchan11-Nov-14 8:25
protectorRichard MacCutchan11-Nov-14 8:25 
AnswerRe: Time of reading text file Pin
Aescleal12-Nov-14 7:01
memberAescleal12-Nov-14 7:01 
QuestionOptimized Solution for prime numbers.. Pin
Raunak Singh Chauhan6-Nov-14 7:20
memberRaunak Singh Chauhan6-Nov-14 7:20 
I have written a program in c++ to check whether a number is prime or not.... I want to know if this is optimized or not..

#include<iostream>
using namespace std;
int main()
{
int num;
cout<<"Enter a number:";
cin>>num;
if(num%6==1 || num%6==5 || num==2 || num==3)
{
cout<<"\n"<<num<<" is a prime number";
}
else
{
cout<<"\n"<<num<<" is not a prime number";
}
return 0;
}

Please help me out...
AnswerRe: Optimized Solution for prime numbers.. Pin
Nicolas Dorier6-Nov-14 7:45
professionalNicolas Dorier6-Nov-14 7:45 
GeneralRe: Optimized Solution for prime numbers.. Pin
Raunak Singh Chauhan6-Nov-14 7:49
memberRaunak Singh Chauhan6-Nov-14 7:49 
GeneralRe: Optimized Solution for prime numbers.. Pin
Nicolas Dorier6-Nov-14 7:56
professionalNicolas Dorier6-Nov-14 7:56 
AnswerRe: Optimized Solution for prime numbers.. Pin
Bernhard Hiller6-Nov-14 23:06
memberBernhard Hiller6-Nov-14 23:06 
Questionget IP address from Net Address Control (Resolved) Pin
bkelly1310-Oct-14 17:06
memberbkelly1310-Oct-14 17:06 
AnswerRe: get IP address from Net Address Control Pin
Richard MacCutchan10-Oct-14 22:18
protectorRichard MacCutchan10-Oct-14 22:18 
GeneralRe: get IP address from Net Address Control Pin
bkelly1311-Oct-14 10:11
memberbkelly1311-Oct-14 10:11 
GeneralRe: get IP address from Net Address Control Pin
Richard MacCutchan13-Oct-14 6:10
protectorRichard MacCutchan13-Oct-14 6:10 
GeneralRe: get IP address from Net Address Control Pin
bkelly1318-Oct-14 11:44
memberbkelly1318-Oct-14 11:44 
GeneralRe: get IP address from Net Address Control Pin
Richard MacCutchan18-Oct-14 22:13
protectorRichard MacCutchan18-Oct-14 22:13 
GeneralRe: get IP address from Net Address Control Pin
bkelly1319-Oct-14 9:42
memberbkelly1319-Oct-14 9:42 
Generalserial port access and communication using c Pin
Member 111402618-Oct-14 23:51
memberMember 111402618-Oct-14 23:51 
GeneralRe: serial port access and communication using c Pin
pasztorpisti9-Oct-14 0:18
professionalpasztorpisti9-Oct-14 0:18 
GeneralRe: serial port access and communication using c Pin
Orjan Westin9-Oct-14 1:58
professionalOrjan Westin9-Oct-14 1:58 
GeneralRe: serial port access and communication using c Pin
pasztorpisti9-Oct-14 2:08
professionalpasztorpisti9-Oct-14 2:08 
GeneralRe: serial port access and communication using c Pin
Orjan Westin9-Oct-14 5:50
professionalOrjan Westin9-Oct-14 5:50 
GeneralRe: serial port access and communication using c Pin
Orjan Westin9-Oct-14 1:55
professionalOrjan Westin9-Oct-14 1:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.