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
3) If an electrical appliance has 150.0 V applied causing a current of 2.34 amps, what is the
ASHA 777 [7]

Answer:

The resistance would be 64.10 ohms.

have a nice day my dude

5 0
3 years ago
How does a purebred individual differ from a hybrid individual?
zimovet [89]
Im gonna go based on the content of their blood. So as the generation continues, a purebred's blood has not differentiated too much and contains 98-100% of a "pure" bloodline meaning no outsiders of where this purebred originated has mixed. A hybrid is where the original bloodline is mixed with many others, so while a purebred has 99% of the original bloodline and the hybrid has 50% and he other half belongs to an entirely different line.
5 0
4 years ago
Explain how astronomers use spectrographs to identify the composition of a star.
Gwar [14]
Each element absorbs light at specific wavelengths unique to that atom. When astronomers look at an object's spectrum, they can determine its composition based on these wavelengths. The most common method astronomers use to determine the composition of stars, planets, and other objects is spectroscopy.
hope this helps you! :-)
4 0
3 years ago
The quinine in tonic water shines a strange blue-white colour when lit with UV light. Explain what is happening here.
Alecsey [184]

Answer:

Here's what I get.

Explanation:

Quinine contains phosphors, substances that glow when they are hit with certain wavelengths of light.

The phosphors in quinine absorb UV light, which is invisible to our eyes.

Electrons in the phosphors absorb the UV energy and are excited to higher energy levels.

When the electrons drop back to lower energy levels, they emit some of this energy as a glowing blue visible light.  

5 0
3 years ago
How to atoms form a new substance
marin [14]

Answer:

they join together

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • 32p is a radioactive isotope with a half-life of 14.3 days. if you currently have 38.1 g of 32p, how much 32p was present 9.00 d
    10·1 answer
  • What is the density of a 5 gram sample that occupies a volume of 10 ml
    8·1 answer
  • Use the graph to determine which is greater, the heat of fusion or the heat of vaporization. Explain how you used the graph to d
    6·1 answer
  • Does the law of conservation of mass apply to physical changes or just chemical changes?
    7·1 answer
  • The reaction of fluorine with ammonia produces dinitrogen tetrafluoride and hydrogen fluoride.
    11·1 answer
  • If silicon has a charge of -4, how many electrons does it have
    10·1 answer
  • What is the ratio of blue-tailed to orange-talied critter pup?
    9·1 answer
  • What element has 14 protons
    14·2 answers
  • The opposite of an endothermic reaction is a(n) reaction.​
    7·2 answers
  • Suppose that a 10-mL sample of a solution is to be tested for I− ion by addition of 1 drop (0.2 mL) of 0.13 M Pb(NO3)2.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!