#7 A lecturer intends to separate his students into
A lecturer intends to separate his students into - Computer Science
ChemistryExplain daily providing Q&A content “#7 A lecturer intends to separate his students into" in Computer science, Ba computer science, Berkeley computer science, a Computer science associate degree jobsGet the Free Online Chemistry Q&A Questions And Answers with explain. To crack any examinations and Interview tests these Chemistry Questions And Answers are very useful. Here we have uploaded the Free Online Chemistry Questions. Here we are also given the all chemistry topic.
ChemistryExplain team has covered all Topics related to inorganic, organic, physical chemistry, and others So, Prepare these Chemistry Questions and Answers with Explanation Pdf.
For More Chegg Questions
Free Chegg Question
1. A lecturer intends to separate his students into 2 groups based on their INDEX Numbers, those with odd numbers in group A and EVEN numbers in B. Use if-else statement to implement this.
2. Your son intends to randomly mention some numbers to you, write a program using a While or do-while loop that will print all the numbers and the sum of the positive numbers”For More Chemistry Notes and Helpful Content Subscribe Our YouTube Chanel - Chemistry Explain
Free Chegg Answer
1.// The INDEX number is input and program
// will tell whether Student is in group A or B
#include <iostream> using namespace std;
int main()
{
int index;
cout << "Enter the INDEX number: ";
cin >> index;
// checks if the number is even or odd
if (index%2==0)
{ cout << "Student goes in Group B" << endl; }
else
{ cout << "Student goes in Group A" << endl;}
return 0;
}
2.
// Assuming the son will mention 10 numbers
#include <iostream std;
int main()
{
int a[10], i=0, sum=0;
while (i < 0)
{
cout << "Enter number: ";
cin >> a[i]
// checks if the number is positive
if (a[i] > 0)
{ sum = sum + a[i]; }
i++;
}
i=0;
cout << "Numbers Entered:" <<endl;
while(i<10)
{cout << a[i] <<" ";}
cout << "Total Of Positive Numbers: " << sum <<endl;
}
Labels: Chegg, Free Chegg Answer, Q&A Computer Science
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home