a society has multiple apartments and each apartment has certain number of people living in it a maximum of 9 people is allowed to live in one apartment the society secretary would like an automated system that takes the number of people living in each apartment and combines to form it a string providing information for all the apartments where an odd number of people are living,write a program for this​

Answers 2

Explanation:

Our findings focus on five AI technology systems: robotics and autonomous vehicles, computer vision, language, virtual agents, and machine learning, which...

please mark my answer as brinliest

Answer:

Algorithm is a step wise solution

Explanation:

  • A society has multiple apartments, and each apartment has a certain number of people living in it.
  • A maximum of 9 people is allowed to live in one apartment.
  • The society secretary would like an automated system that takes the number of people living in each apartment and combines it to form a string, providing information for all the apartments where an odd number of people are living.

To find: Write an algorithm to make an automated system that will find all the odd digits from the given number.

Program:

include <bits/stdc++.h>

using namespace std;

int main()

{

 string s,p;

 cin >> s;

 int n = s.length();

 for(int i=0;i<n;i++)

 {

     if((s[i]-48) % 2 != 0)

     p.push_back(s[i]);

 }

 cout << p;

}

If you know the answer add it here!

Can't find the answer?

Log in with Google

or

Forgot your password?

I don't have an account, and I want to Register

Choose a language and a region
How much to ban the user?
1 hour 1 day 100 years