Answer and Explanation:
In C programming language:
char fun(int*a, int*b){
printf("enter two integers: ");
scanf("%d%d",a,b);
int e;
printf("please enter a character: ");
e=getchar();
return e;
}
int main(int argc, char *argv[]) {
int d;
int f;
int g;
fun();
printf("%d%d%d", d, f, g);
}
We have declared a function fun type char above and called it in main. Note how he use the getchar function in c which reads the next available character(after the user inputs with printf()) and returns it as an integer. We then return the variable e holding the integer value as char fun() return value.
<span> You can block attackers, who are performing reconnaissance and probing, with NMAP and Nessus port scanning and vulnerability assessment scanning tools by i</span>dentifying the digital signatures of common reconnaissance and probing tools such PING, scans performed by Nmap, Nessus®, etc. The IDS and IPS devices should be programmed to specifically alert and block reconnaissance and probing IP packets that are commonly used by these attack tools.
The logic gates are shown right below your truth tables... lol.
Answer:
The program to this question as follows:
Program:
value = input("Input text value: ") #defining variable value and input value by user
word = value.split() #defining variable word that split value
sort_word = sorted(word) #defining variable using sorted function
unique_word = [] #defining list
for word in sort_word: #loop for matching same value
if word not in unique_word: #checking value
unique_word.append(word) #arrange value using append function
print(' '.join(unique_word)) #print value
Output:
Input text value: Good morning Good afternoon Good evening
Good afternoon evening morning
Explanation:
In the above python code, a value variable is defined that uses input function to input value from the user end, and the word variable is declared, which uses the split method, which split all string values and defines the sort_word method that sorted value in ascending order.
- Then an empty list "unique_word" is defined, which uses the for loop and inside the loop, a conditional statement is used.
- In if block, it matches all value is unique if this is condition is true it will arrange all values and uses the print function to print all value.
Answer:
// program that implement the algorithm to find the change.
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variables
int cost,q,d,n,p;
cout<<"Enter the cost of item between 25 cents and a dollar, in 5 increments (25, 30, 35, … , 90, 95, or 100):";
// read the cost
cin>>cost;
// find the change
int change=100-cost;
// find quarter
q=change/25;
change=change%25;
// find the dimes
d=change/10;
change=change%10;
// find the nickels
n=change/5;
// find the pennies
p=change%5;
// print the change
cout<<"Your change is: "<<q<<" quarter,"<<d<<" dimes,"<<n<<" nickels and "<<p <<" pennies."<<endl;
return 0;
}
Explanation:
Read the cost of item from user and assign it to variable "cost".Then find the change to be returned to user.Then find the quarter by dividing the change with 25.Update the change and then find the dimes by dividing change with 10.Then update the change and find nickels and then find the pennies.Print the change to be returned.
Output:
Enter the cost of item between 25 cents and a dollar, in 5 increments (25, 30, 35, … , 90, 95, or 100):45
Your change is: 2 quarter,0 dimes,1 nickels and 0 pennies.