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
Which of the following statements about the nucleus is false?
GarryVolchara [31]

Answer:

B. Able to be lost or gained in chemical reactions.

6 0
3 years ago
Read 2 more answers
As a consumer what kind of economic problems do we face?​
alina1380 [7]

Answer:

Benefits. Businesses use consumer spending data in their supply and demand economic calculations. Supply and demand helps businesses produce goods or services at the most favorable consumer price points. ... Consumer spending helps companies determine which products have the most value in the economic marketplace.

Explanation:

E

4 0
4 years ago
A balloon contains 146.o mL of gas confined at a pressure of 1.30 atm and a temperature of 5.0 C If the pressure doubles and the
polet [3.4K]
 the pressure would be 292, did i calculate that right?
8 0
3 years ago
I have NO CLUE??? Can you plz plz help me
lbvjy [14]
It’s c What’s not part of the solar system which is almost around the heat on my dog
6 0
3 years ago
X là hỗn hợp 2 este đơn chức đồng phân được tạo bởi 1 ancol và 2 axit hữu cơ. Cho 11,6g hỗn hợp X tác dụng với NaOH vừa đủ thu đ
Charra [1.4K]

Answer:

...

Explanation:

i don't understand sorry :)

4 0
3 years ago
Other questions:
  • What condition of the gas remains constant?
    5·1 answer
  • Question 7.7. All amino acids have a central carbon with four components attached to it. One of these components is called the R
    6·1 answer
  • A military jet cruising at an altitude of 12.0kmand speed of 1900./kmh burns fuel at the rate of 74.4/Lmin. How would you calcul
    5·1 answer
  • Calculate the amount of nacl needed to prepare 50 ml of 0.9% nacl solution and 20% nacl solution
    13·1 answer
  • Which of the following most likely happens when the temperature of a gas increases?
    9·2 answers
  • The concentration of a certain sodium hydroxide solution was determined by using the solution to titrate a sample of potassium h
    15·1 answer
  • What can be added to an atom to cause a nonvalence electron in the atom to temporarily become a valence electron?
    15·2 answers
  • A hot pot of water is set on the counter to cool. After a few minutes it has lost 495 J of heat energy. How much heat energy has
    15·1 answer
  • Why is it impossible to have an undiscovered element that would fit between sodium and magnesuim
    12·1 answer
  • (b) Do compounds of hydrogen exhibit a relatively large or small kinetic isotope effect? Explain.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!