The answer & explanation for this question is given in the attachment below.
Yes Microsoft and Apple used the closed-source approach to better secure from malware and make to make their operating systems more user friendly.
1. True
2. Usually true, but it depends on the search engine you're using. For example, Google lets you search for several words without commas.
Answer:
#include<bits/stdc++.h>
using namespace std;
int sumOfinteger(int );
// Returns sum of all digits in numbers from 1 to n
int sumOfintegersFrom1ToN(int n) {
int result = 0; // initialize result
// One by one compute sum of digits in every number from
// 1 to n
for (int x = 1; x <= n; x++)
result += sumOfinteger(x);
return result;
}
// A utility function to compute sum of digits in a
// given number x
int sumOfinteger(int x) {
int sum = 0;
while (x != 0) {
sum += x %10;
x = x /10; }
return sum; }
// Driver Program
int main() {
int n ;
cout<<"enter a number between 1 and n : ";
cin>>n;
cout << "Sum of digits in numbers from 1 to " << n << " is " << sumOfDigitsFrom1ToN(n);
return 0; }