this is my code
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int i,n;
int isprime;
cin>>n;
isprime=1;
i=abs(n); //neglect negative numbers
n=i;
if (n%2==0 && n!=2) isprime=-1;
while (i>2 && isprime==1) {...
no you dont and you still dont get it, im talking about the part thats bold :P
#include<stdio.h>
int main(){
int i,j,s,ip;
scanf("%d",&s);
ip=1;
j=s;
i=2;
while(s>2&&i*i<=s){
if(j%2==0||s%i==0){ip=-1;break;}
i++;
}...
i can understand that thats why i said u can make it faster by adding things but you let the even check be in the while loop is its slower than you think trust me i have been programming for 6 years :P
i;ve told him twice to use the even check for j before the while but no point :P eya asa na lu but he says his prog is fast you know anyway that we can get tick count in c++?
oya komada kiyanne api denna athara mona hari wenawa mai kiyala lmao eka hama ekenatama podu wene na ne ane me machan man danawane pakistan wala ganunta salakana hati ewa gana katakarana ko discovery eke ona taran program yanawa mewa prashnada? ewath eka gathama, wena ekek eka katha kara kiyala...
Shorter code doesnt mean its fast! you're still using the even check inside the while loop j doesnt change with i so why did you put it inside the while loop? theres no need of checking the same number whether its even or not again and again?, you make it faster by other things but make it alot...
yea fully VB, graph supports graphical differentiation and integration ;p mage pixu wada mona aiya da ane man 2008 AL mora ringa gana zscore madi UCSC yanawa hambunoth :P
source eka denam commercial wada ba
i did think that 1 is a prime when i was coding :P it should be it is dividable by 1 and itself which we see as a common thing in all other prime numbers, its just a definition not actual math. I didnt now the definition at the time of coding and i thought of the common factor in all primes and...
I didnt change anything it works well man :P i edited the code some while ago(before you said it has a bug) to make it shorter after posting in EK u may have copied the program then copy it now and see
I copied the code from EK then compiled a new project same result(this is the exact code that...