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
Examine the photo of quartz below in which way does the quartz break
AveGali [126]
Can u add a link please 

4 0
3 years ago
Carbon dioxide is a...
Marina86 [1]

Answer: Option B) Pure Substance &

Compound

Explanation:

Carbon dioxide is a compound because it is formed when one carbon atom and two oxygen atoms chemically combined together.

C(s) + O2(g) ---> CO2(g)

Also, CO2 is a pure substance because it is natural and cannot be broken down easily or separated by physical methods.

5 0
3 years ago
What are the columns on the periodic table called?
Stels [109]
Families are another names for the columns
8 0
3 years ago
Read 2 more answers
Pls I need help with my polymer homework <br> I WILL GIVE BRAINIEST
Wewaii [24]

Answer:

567=1 345=4 and 57=9

Explanation:

6 0
3 years ago
What is the chemical formula of magnesium bromide? A. MgBr2 B. MgBr C. Mg2Br2 D. Mg2Br
DanielleElmas [232]
A. MgBr2
because Mg2+ and Br-
7 0
3 years ago
Other questions:
  • What acid has a dissociation constant of 4.57x10^-3
    14·1 answer
  • HELP!!!!!
    14·1 answer
  • Sterling silver contains 92.5 percent silver and 7.5 percent copper. which substance is the solute?
    15·2 answers
  • Why are very few 2+ ions formed in a mass spectrometer?
    7·1 answer
  • A base can neutralize an acid. true or false
    12·2 answers
  • Ecology is defunded as the environment study of
    14·2 answers
  • Match the term with its description.
    8·2 answers
  • A piece of wood burns to form ash. ____C_____ Water evaporates into steam. ____P_____ A piece of cork is cut in half. ____P_____
    13·1 answer
  • What type of reaction is Mg + 2Ag -&gt; mg2 + 2Ag
    10·1 answer
  • How many grams of silver nitrate are required to produce 3.00 g of silver phosphate?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!