ASSIGNMENT INFORMATION Points Possible 25 1. Write a program to print all the nu
ID: 3600255 • Letter: A
Question
ASSIGNMENT INFORMATION Points Possible 25 1. Write a program to print all the numbers from 1 till 100. Print all the numbers which are multiples of 5 2. Write a program to print sum of all the numbers between 25 and 75. 25+26+27 74+75 3. Wirite a program to print sum ofall he multiples of 5 between 1 and 100. 5+10+15 100 4. Write a program to get numbers from the user and find the total sum until user enters a negative 5. write a program to check if a number user entered is prime or not 6. Write a program to get number from user and print the following pattern second pattern 12Explanation / Answer
Note : Hey , I am doing these Questions in C++ language.
Solution 1 ]
#include<iostream>
using namespace std;
int main()
{
for(int i=1;i<=100;i++)
{
if(i%5==0)
{
cout<<" "<<i;
}
}
return 0;
}
Solution 2 ]
#include<iostream>
using namespace std;
int main()
{
int sum=0;
for(int i=25;i<=75;i++)
{
sum=sum+i;
}
cout<<"Sum = "<<sum;
return 0;
}
Solution 3 ]
#include<iostream>
using namespace std;
int main()
{
int sum=0;
for(int i=1;i<=100;i++)
{
if(i%5==0)
{
sum=sum+i;
}
}
cout<<"Sum = "<<sum;
return 0;
}