Search This Blog

Tuesday, March 29

code to find prime no's

void main()
{



int n,i,rem=0;

cout<<"Enter the number U want to check"; cin>>n;

if(n==0)
cout<<"The number is not prime";

if(n==1)
cout<<" The number is prime";

if(n==2)
cout<<"The number is even-prime;

else
if((n!=0) && (n!=1) && (n!=2))
{
for(i=2; i {
rem=n%i;

if(rem==0)
{
break;//come out of for loop
}

}
}

if(rem==0)
{
Cout<<"The number is not a prime";
}
else
if(rem!=0)
{
cout<<"The num is a prime";
}
getch();
}

hi srilekha...neekosame ee code

void main()
{

int a[3][3];

int i,j,n;

int max=0, second_max=0;

cout<<"Enter the numbers in the array sequentially"; for(i=0;i<3;i++) { for(j=0;j<3;j++) { cin>>n;
a[i][j]=n;
}
}

// With this all the required numbers have been inserted into the array successfully as per the user's choice.This is a 3X3 array...You can change the size as per ur choice.


for(i=0;i<3;i++) { for(j=0;j<3;j++) { (if(a[i][j]>a[i][j+1])&&(a[i][j]>max))

{
max=a[i][j];
//This max has the highest element.
}
}
}


//But we have to find the second largest element...so compare all the elements again with themselves and with the max


for(i=0;i<3;i++) { for(j=0;j<3;j++) { (if(a[i][j]>a[i][j+1])&&(a[i][j]
{
second_max=a[i][j];
//This max has the highest element.
}
}
}

//Now, we have the second largest element print it out.
Cout<<"The second largest element is< getch();

}

Sunday, October 24

ISRO

Aiming to enhance India's defence surveillance capabilities, Indian Space Research Organisation (ISRO) is all set to launch its first Radar Imaging Satellite (RISAT) and micro educational satellite, ANUSAT, from its spaceport in Sriharikota at 6.45a.m Monday, the Press Trust of India (PTI) reported.

According to ISRO, Polar Satellite Launch Vehicle-C12 (PSLV-C12) would carry the 300-kg RISAT-2 and 40-kg micro satellite, ANUSAT, built by Anna University.

RISAT, to be launched from Sriharikota on the east coast of the south-eastern state of Andhra Pradesh, some 80km north from here, has all weather capability to take images of the Earth and would also be beneficial in mapping and managing natural disasters, such as floods and landslides, besides amplifying defence surveillance capabilities of the nation.

As per specifications, RISAT is different from previous remote sensing satellites as it uses Synthetic Aperture Radar (SAR), equipped with many antennas to receive signals that are processed into high-resolution pictures.

The SAR, developed by Israel Aerospace Industries, gives RISAT defence capabilities.