Computer Science, asked by 1716510044, 18 days ago

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

Answered by advyetas
11

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

Answered by ravilaccs
0

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;

}

Similar questions