Answer:
C++ code is explained below
Explanation:
a- C++ code:
#include<iostream>
using namespace std;
#include <string.h>
int firstOccurence(char *s,char c) //recursive function
{
static int i;
if(!s[i])
{
return -1;
}
else
{
if(s[i]==c)
return i;
i++;
firstOccurence(s,c);
} }
int main()
{
char s[1000],c;
int n;
printf("Enter the string : "); //tales input
gets(s);
printf("Enter character to be searched: "); //takes input a character to be searched
c=getchar();
n=firstOccurence(s,c); //call function
if(n>-1)
printf("character %c is first occurrence at location:%d ",c,n);
else
printf("character is not in the string ");
return 0;
}
b- C++ Code- This program takes a string and display sum of all characters in a string.
#include<iostream>
using namespace std;
int sumAscii(string s) //recursive function
{
int sum = 0;
if(s.length() == 0)
{
exit(0);
}
for (unsigned int i = 0; i < s.size(); i++)
{
sum += s[i];
}
return sum;
}
int main () //main function
{
cout << "This word adds up to " << sumAscii("CAT") << " in ASCII " << endl;
return 0;
}
Answer:
ASIC
Explanation:
I will be using the ASIC, which is an application-specific integrated circuit. And we know here the purpose for which we need the Integrated circuit. And FPGA stands for Field Programmable Gate Array, and it is field-specific like one we have for the Bitcoin. Hence, the correct option here is ASIC and not FPGA.
Answer:
with only 1 print statement and using No Space Characters, output the text ... quote_me takes a string argument and returns a string that will display ... White has sizes L, M; Blue has sizes M, S ... input("Input shirt color: ").lower() size = input("Input shirt size: ").upper() if color ... call the function with a string from user input.
Read the pseudo code for the program: Input: Ask user what size shirt—small, medium, large, or extra-large. Ask user what color—blue, green, red, or yellow. Ask user what design—chevron, solid, or stripes. Output: Print a message that clearly displays the user's shirt size, color, and design.
Explanation:
It really would depend on what E-Mail system you're using.
If say, you're using G-Mail, the Recipient's address would be placed simply in the "To" bar right above the "Subject" bar.