nirjhar18
BAN USER#include<iostream>
using namespace std;
main()
{
int a,b;
cout<<"Enter the Lower limit:";
cin>>a;
cout<<"Enter the Upper Limit:";
cin>>b;
for(int i=a; i<=b; i++)
{
int temp=a;
int temp1=temp/temp;
int temp2=temp % 2;
int temp3=temp % 3;
int temp4= temp % 5;
int temp5=temp % 7;
if(temp1==1 )
{
if(temp2 !=0)
{
if(temp3 !=0)
{
if(temp4!=0)
{
if(temp5!=0)
{
cout<<temp<<"is prime"<<endl;
}
}
}
}
a++;
}
}
return 0;
}
#include<iostream>
- nirjhar18 November 04, 2012using namespace std;
main()
{
int SIZE=3;
int arr[]= {10,1,3,25};
int max_sum=0;
for(int i=0; i<SIZE-1; i++)
{
int sum=arr[i]+arr[i+2];
if(sum > max_sum)
{
max_sum=sum;
}
}
int sum1=arr[0] + arr[SIZE];
if(max_sum<sum1)
{
max_sum=sum1;
}
cout<<max_sum<<"is greatest";
}