Answer:
#include <iostream>
#include <cstring>
using namespace std;
void replacePeriod(char* phrase) {
int i = 0;
while(*(phrase + i) != '\0')
{
if(*(phrase + i) == '.')
*(phrase + i) = '!';
i++;
}
}
int main() {
const int STRING_SIZE = 50;
char sentence[STRING_SIZE];
strcpy(sentence, "Hello. I'm Miley. Nice to meet you.");
replacePeriod(sentence);
cout << "Updated sentence: " << endl;
cout << sentence << endl;
return 0;
}
Explanation:
- Create a function called replacePeriod that takes a pointer of type char as a parameter.
- Loop through the end of phrase, check if phrase has a period and then replace it with a sign of exclamation.
- Inside the main function, define the sentence and pass it as an argument to the replacePeriod function.
- Finally display the updated sentence.
The program below is able to calculate the area of a circle inscribed in a Square.
<h3>What is a program?</h3>
A program is a set of instructions given to the computer with specific end results in mind.
<u>Sample program in Java
</u>// Java Program to find the area of
// an inscribed circle in a square.
import java.io.*;
class GFG {
static double PI = 3.14;
// Function to find area of an
// inscribed circle in a square.
static double areaOfInscribedCircle(float a)
{
return ( PI / 4 ) * a * a;
}
// Driver code
public static void main (String[] args)
{
float a = 8;
System.out.println("Area of an inscribed"
+ " circle: " + areaOfInscribedCircle(a));
}
}
Learn more about programs at :
brainly.com/question/1538272
#SPJ1
Answer:
A
Explanation:
.
.stack 4096
ExitProcess PROTO, dwExitCode:DWORD
.data
Sun=0
Mon=1
Tue=2
Wed=3
Thu=4
Fri=5
Sat=6
warray BYTE Sun, Mon, Tue, Wed, Thu, Fri, Sat
INVOKE ExitProcess, 0