Answer:
#include <bits/stdc++.h>
using namespace std;
bool isPrime(int n)
{
for(int j=2;j<=n-1;j++) //loop to check prime..
{
if(n%j==0)
return false;
}
return true;
}
int main(){
int n;
cout<<"Enter the integer"<<endl;//taking input..
cin>>n;
if(isPrime(n))//printing the message.
{
cout<<"The number you have entered is prime"<<endl;
}
else
{
cout<<"The number is not prime"<<endl;
}
return 0;
}
Output:-
Enter the integer
13
The number you have entered is prime
Explanation:
The above written program is in C++.I have created a function called isPrime with an argument n.I have used a for loop to check if the number is prime or not.In the main function I have called the function isPrime for checking the number is prime or not.
A wiki. (one example is Wikipedia)
Answer:
The correct for the given question is option(c) i.e .-1.
Explanation:
Strcmp() function is used to compare the two string .it compare the string character by character strcmp() function return the three value on comparison.
(1) if string 1 is equal to string 2 it return 0;
(2) it return>0 if string1 has greater ASCII value than string 2
(3) it return <0 if string1 has smaller ASCII value than string 2
In the given code strcmp returns -1 value the ASCII code of character 'A' has smaller then ASCII code 'X';
Following are the program of given code
#include<stdio.h>// header file
#include<string.h>
int main() // main method
{
char x;
x =strcmp( "ABCD", "XXX" );
printf("%d",x);
return 0;
}
Output:-1
Answer:
We will SQL(Structured Query Language) designed for this specific problem to manage the data base for the library management system.This querry SQL based system will ask the user to tell the first name and this SQL based system will his full name.