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
Calculate the mass of Cr(ClO2)2 that contains 5.57 × 10<br> ^22 chlorine atoms.
Anna007 [38]

Answer:

Explanation:

Your strategy here will be to

use the chemical formula of carbon dioxide to find the number of molecules of

CO

2

that would contain that many atoms of oxygen

use Avogadro's constant to convert the number of molecules to moles of carbon dioxide

use the molar mass of carbon dioxide to convert the moles to grams

So, you know that one molecule of carbon dioxide contains

one atom of carbon,

1

×

C

two atoms of oxygen,

2

×

O

This means that the given number of atoms of oxygen would correspond to

4.8

⋅

10

22

atoms O

⋅

1 molecule CO

2

2

atoms O

=

2.4

⋅

10

22

molecules CO

2

Now, one mole of any molecular substance contains exactly

6.022

⋅

10

22

molecules of that substance -- this is known as Avogadro's constant.

In your case, the sample of carbon dioxide molecules contains

2.4

⋅

10

22

molecules CO

2

⋅

1 mole CO

2

6.022

⋅

10

23

molecules CO

2

=

0.03985 moles CO

2

Finally, carbon dioxide has a molar mass of

44.01 g mol

−

1

, which means that your sample will have a mass of

0.03985

moles CO

2

⋅

44.01 g

1

mole CO

2

=

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

∣

∣

a

a

1.8 g

a

a

∣

∣

−−−−−−−−−

The answer is rounded to two sig figs, the number of sig figs you have for the number of atoms of oxygen present in the sample.

3 0
2 years ago
What volume would a 0. 250 mole sample of h2 gas occupy if it had a which a a pressure of 1. 70 atm and a temperature of 35 C?
frosja888 [35]

The volume of  0. 250 mole sample of H_{2} gas occupy if it had a pressure of 1. 70 atm and a temperature of 35 °C is  3.71 L.

Calculation,

According to ideal gas equation which is known as ideal gas law,

PV =n RT

  • P is the pressure of the hydrogen gas  = 1.7 atm
  • Vis the volume of the hydrogen gas = ?
  • n is the number of the hydrogen gas = 0.25 mole
  • R is the universal gas constant = 0.082 atm L/mole K
  • T is the temperature of the sample = 35°C = 35 + 273 = 308 K

By putting all the values of the given data like pressure temperature universal gas constant and number of moles in equation (i) we get ,

1.7 atm×V = 0.25 mole ×0.082 × 208 K

V = 0.25 mole ×0.082atm L /mole K × 308 K /1.7 atm

V = 3.71 L

So, volume of the sample of the hydrogen gas occupy is  3.71 L.

learn more about ideal gas equation

brainly.com/question/4147359

#SPJ4

4 0
1 year ago
Can somebody plz help answer both questions correctly thank you!!
const2013 [10]

Answer:

answer #1 used throughout the world to power devices, appliances and methods of transportation utilized in daily life. To make things operate, electrical energy must be emitted from energy sources such as power plants, to enable an object to consume the power it needs to function. ((if you want to cut it down short use the two first sentences))

answer #2 We get solar heat energy from the sun, and sunlight can also be used to produce electricity from solar

Explanation:

4 0
2 years ago
How much heat is added if .0948g of water is increased in temperature by .728 degrees C?
Verdich [7]

Answer:

0.289J of heat are added

Explanation:

We can relate the change in heat of a substance with its increasing in temperature using the equation:

q = m*ΔT*S

<em>Where Q is change in heat</em>

<em>m is mass of substance (In this case, 0.0948g of water)</em>

<em>ΔT = 0.728°C</em>

<em>S is specific heat (For water, 4.184J/g°C)</em>

Replacing:

q = 0.0948g*0.728°C*4.184J/g°C

q = 0.289J of heat are added

5 0
2 years ago
Which of the following is a pure substance? Choose all that apply.
worty [1.4K]
Nickel is a pure substance

Rust is also a pure substance
7 0
3 years ago
Read 2 more answers
Other questions:
  • What can electrons hold
    9·1 answer
  • In a balanced reaction NH3+ H2O—&gt; NH3OH how many hydrogens atoms are gained in the reaction
    15·1 answer
  • For the n = 3 electron shell, which of the following quantum numbers are valid? Check all that apply.
    11·2 answers
  • The graph of y = 3x2 + 12x + 11 is shown.
    8·1 answer
  • What is the ΔG given the following? ΔH = 20 kJ/mol T = 15°C ΔS = .101 kJ/molK
    14·1 answer
  • A) An iron nail is attracted to a magnet.
    10·2 answers
  • How many atoms are in 5Na3PO4​
    15·1 answer
  • Which of these pairs of elements have the same number of valence electrons?​
    13·1 answer
  • Can someone help its confusing
    9·1 answer
  • 6. What do we call Ethene that has been polymerised?​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!