Answer:
Explanation:
bool isPalindrome(string str)
{
int length = str.length();
for (int i = 0; i < length / 2; i++) {
if (str [i] != str [length – 1 – i]) {
return false;
}
}
cout << str << "is a palindrome";
return true;
}
Answer:
They are both ways to identify assets (e.g., persons, animals, objects).
Explanation:
A barcode is a bit of information (usually a number) printed as a line or block pattern on a surface (e.g., a sticker).
An RFID is a bit of computer memory with an antenna.
Both can be read with the appropriate scanner device.
Answer:
// This program is written in C++
// Comments are used for explanatory purpose
// Program starts here
#include<iostream.h>
#include<stdlib.h>
int main()
{
// Declare variables
int num, selectno;
string status;
randomize();
//Generate random number;
num=rand()%10000;
// Prompt to guess a number
cout<<"You have only 10 tries\nTake a guess: ";
int tries = 0;
while (tries != 10)
{
cin>>selectno;
if(selectno == num){
cout<<"You passed at the "<<count+1<<" attempt";
tries = 10;
}
else
{
cout<<"You failed. Take another guess\n You have "<<10 - count + 1 <<" attempts";
}
tries++;
if(tries >= 10)
{
break;
}
}
return 0;
}
Answer:
Output explanation to the given code can be defined as follows:
Explanation:
In A the output is 0
, It will return fork value of the child process that is 0. so, 0 is printed during child process.
In B the output is 2650
, in which the getpid() method returns the child process id value that is 2650.
In C the output is 140, As it is declared in key, all process have their own "value" copies. 20 are inserted during childhood, so 140 are written.
In D the output is 2650, its fork() method returns the child ID to the parent process. so the value 2650 is printed.
In E the output is 2600, Its getpid() method will returns parent process id that is equal to 2600.
In F the output is 120 Since the value is declared in primary, all process so their own "value" copies. 120 will be printed during process.