guys I have doubt in these que....I will give many points
Attachments:
Answers
Answered by
1
it isn't possible to write all 15 java programs.....
sorry
yashthoapte11:
plz tell
Answered by
3
2. for even numbers - will be done the same way as mentioned below except the number in output should come out to be even.
3. (for odd number)
#include <iostream>
using namespace std;
int main(){
for(int i = 0; i < 10; i++){
cout << 2 * i + 1 << ' ';
}
return 0;
}
5. sum of first 10 number
#include <iostream>
using namespace std;
int main()
{
int i,sum=0;
cout << "\n\n Find the first 10 natural numbers:\n";
cout << "---------------------------------------\n";
cout << " The natural numbers are: \n";
for (i = 1; i <= 10; i++)
{
cout << i << " ";
sum=sum+i;
}
cout << "\n The sum of first 10 natural numbers: "<<sum << endl;
}
Similar questions