1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Olegator [25]
3 years ago
7

Write a c++ program that prints the intial letter of any name​

Chemistry
2 answers:
Masteriza [31]3 years ago
6 0

Answer:

please mark as brainliest!!

Explanation:

// C++ program to print initials of a name  

#include <bits/stdc++.h>  

using namespace std;  

 

void printInitials(const string& name)  

{  

   if (name.length() == 0)  

       return;  

 

   // Since touuper() returns int, we do typecasting  

   cout << (char)toupper(name[0]);  

 

   // Traverse rest of the string and print the  

   // characters after spaces.  

   for (int i = 1; i < name.length() - 1; i++)  

       if (name[i] == ' ')  

           cout << " " << (char)toupper(name[i + 1]);  

}  

 

// Driver code  

int main()  

{  

   string name = "prabhat kumar singh";  

   printInitials(name);  

   return 0;  

}

VARVARA [1.3K]3 years ago
6 0

Answer:

#include<iostream>

using namespace std;

int main(){

char str[20];

int i=0;

std::cout<<"Enter a name:" ;

cin>>str;

cout<<*str;

while(str[i]!='\0'){

if(str[i]==' '){

i++;

cin>>*(str+i);

}

i++;

}

return 0;

}

You might be interested in
C2h6o how many moles of ethanol are present in a 10.0 g sample of ethanol
Dmitriy789 [7]
46 gram of ethanol ≡ 1 mole of ethanol
1 gram of ethanol ≡ 1/46 mole of ethanol
10 gram of ethanol ≡ 1*10/46 mole of ethanol
                               =0.217 mole of ethanol
5 0
3 years ago
Read 2 more answers
1 what do you understand by the term isotopes 2 why do I should talk of an element process identical chemical properties 3 name
Bad White [126]

Answer:

Isotopes of an element have same number of protons but different number of neutrons. Which means isotopes of an element have same atomic number but different mass number.

The chemical property of an element is determined by the number of electrons. And as all the isotopes have same number of electrons, they have same chemical properties.

Thus as isotopes of an element have same atomic number , they have same number of electrons and protons. As they have different mass number, the number of neutrons will be different. Hydrogen has three isotopes , ^1_1\textrm{H}, ^2_1\textrm{H} and ^3_1\textrm{H}. Thus ^1_1\textrm{H} has no neutron.

5 0
2 years ago
Shown is an infrared image of a star, Beta Pictoris. Why would scientists use infrared light to take this image instead of
makvit [3.9K]
B is the correct answer
3 0
2 years ago
What are examples of everyday chemical reactions?
Softa [21]
<span>Photosynthesis Is a Reaction To Make Food</span>
7 0
3 years ago
6.
levacccp [35]

Answer:

the time required for one half of a sample of a radioisotope to decay

7 0
2 years ago
Other questions:
  • 23. How would you say: The players competed well. (1 point)
    14·1 answer
  • Acetic acid is an example of __________.
    10·2 answers
  • If an atom has a mass number of 25 and an atomic number of 11 how many neutrons are there in this atom?
    7·1 answer
  • Elastic energy is stored when an object is stretched. Is this an example
    11·1 answer
  • Consider the molecule SiCl4. The electronegativity values for Si and Cl are 1.8 and 3.0, respectively. Based on these values and
    6·2 answers
  • Take a look at this weather map. What do you think the H and L represent?
    11·2 answers
  • What so ammonia and bleach make
    7·1 answer
  • Does anyone want to do stoichiometry? <br> im so tired of chemistry.
    13·2 answers
  • Two students made a model of the world's tallest building, the Burj Khalifa in Dubai. The scale of the model is 1:400. The stude
    11·1 answer
  • 1. Most of an atom is empty space, except for a tiny, dense core called the ___.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!