Click here to Skip to main content
14,690,227 members
Home » Discussions » ATL / WTL / STL
   

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
mveRichard 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
mveRichard 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
mveRichard 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
mveRichard 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
mveRichard 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
mveRichard 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
xenotron9-Oct-14 0:18
Memberxenotron9-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
xenotron9-Oct-14 2:08
Memberxenotron9-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.