Answer:
int SmallestNumber(int num1, int num2, int num3){
int smallest;
if (num1 >num2){
smallest=num2;
}
else {
smallest=num1;
}
if(smallest <num3){
smallest=num3;
}
}
int LargestNumber(int num1, int num2, int num3){
int largest;
if (num1 <num2){
largest=num2;
}
else {
largest=num1;
}
if(largest>num3){
largest=num3;
}
}
void main(){
int num1,num2,num3;
printf("enter values");
scanf("%d%d%d",&num1,&num2,&num3);
int smallest=SmallestNumber(num1,num2,num3);
int largest=LargestNumber(num1,num2,num3);
}
Explanation:
we are comparing first two numbers and finding largest among those. After getting largest comparing that with remaining if it is greater then it will be largest of three. Same logic applicable to smallest also
Answer:
The program in C++ is as follows:
#include <iostream>
#include <vector>
using namespace std;
int main(){
int n;
cout<<"Elements: ";
cin>>n;
vector <int>num;
int input;
for (int i = 1; i <= n; i++){ cin>>input; num.push_back(input); }
int large, seclarge;
large = num.at(0); seclarge = num.at(1);
if(num.at(0)<num.at(1)){ large = num.at(1); seclarge = num.at(0); }
for (int i = 2; i< n ; i ++) {
if (num.at(i) > large) {
seclarge = large;;
large = num.at(i);
}
else if (num.at(i) > seclarge && num.at(i) != large) {
seclarge = num.at(i);
}
}
cout<<"Second Largest: "<<seclarge<<endl;
int small, secsmall;
small = num.at(1); secsmall = num.at(0);
if(num.at(0)<num.at(1)){ small = num.at(0); secsmall = num.at(1); }
for(int i=0; i<n; i++) {
if(small>num.at(i)) {
secsmall = small;
small = num.at(i);
}
else if(num.at(i) < secsmall){
secsmall = num.at(i);
}
}
cout<<"Second Smallest: "<<secsmall;
return 0;
}
Explanation:
See attachment for explanation
Answer:
how much robux
Explanation:
username is Naiz211
u got to create if u are on your computer it doesn't work on mobile and
Answer:
2. determine where they are not successfully blocking goals.
Explanation:
In the game of ice hockey, a goalie also referred to as goaltender refers to an individual (player) who is saddled with the responsibility of preventing the hockey puck from going into his or her net. When the hockey puck is prevented by the goalie, it simply means that the opposing team is prevented from having a goal or scoring.
The area in front of the net where a goalie plays is known as goal crease.
By recording where a hockey puck goes into a net, a goalie can determine where they are not successfully blocking goals because it helps them to see where they successfully made a save (block) and where they did not.