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
Determine the electron geometry, molecular geometry, and idealized bond angles for each of the following molecules. CF4CF4 NF3NF
vfiekz [6]

Answer:

CF4

Molecular geometry- tetrahedral

Electron geometry- tetrahedral

NF3

-molecular geometry - trigonal pyramidal

Electron geometry - tetrahedral

OF2

Molecular geometry - bent

Molecular geometry - tetrahedral

H2S

Molecular geometry- bent

Electron geometry - tetrahedral

Explanation:

According to Valence Shell Electron Pair Repulsion Theory, the shape of a molecule depends on the number of electron pairs on the valence shell of the central atom in the molecule.

For all the compounds listed, the central atom has four points of electron density. This correspond to a tetrahedra electron pair geometry. The presence of lone pairs on the central atom of OF2,NF3 and H2S accounts for the departure of the observed molecular geometry from the geometry and idealized bond angle predicted on the basis of the VSEPR theory.

5 0
3 years ago
Explain how unstable atoms gain stability
IRINA_888 [86]
The atoms decay until the nucleus is balanced again 

4 0
3 years ago
What is the first step in creating a Lewis structure for a molecule?
lilavasa [31]
You should first count all the valence electrons. Then draw the central atom and single bonds to the rest (then go from there)
4 0
3 years ago
______ fats contain no carbon-carbon double bonds, whereas ______ fats contain carbon-carbon double bonds.
slavikrds [6]
Blank 1: Saturated

Blank 2: Unsaturated

Carbon double bonds mean that there is not the max amount of carbon atoms present in the chain and the word saturated means full
8 0
2 years ago
What is 13,040,000 in scientific notation?
MatroZZZ [7]
<span>1.304 x 10^7! Hope this helped.</span>
3 0
3 years ago
Read 2 more answers
Other questions:
  • which term best describes all atoms in ionic bonnds ? A)stable B)unstable C)positively charged D)negatively charged
    12·2 answers
  • Find the volume in milliliters of 2.00 mol of an ideal gas at 36°C and a pressure of 1120 torr.
    14·1 answer
  • Assuming that the distances between the two ions are the same in all cases, which of the following ion pairs has the greatest el
    10·1 answer
  • What is the correct name for Na20?
    6·2 answers
  • The definition of a limiting reactant can be summarized as:
    14·1 answer
  • Which of the following formulas represents an ionic compound?
    12·1 answer
  • Chlorine–35 has 17 protons. How many protons and neutrons does the isotope chlorine–36 have?
    8·2 answers
  • What is the most metallic item on the pterotic table
    11·2 answers
  • Over a period of 30 days a student studied the night sky and recorded his observations. One night he watched a shooting star str
    14·1 answer
  • There are 2 pictures, please answer this question
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!