#include<iostream.h>
#include<conio.h>
void main()
{
int i;
clrscr();
for(i = 1; i < = 10; i++)
cout<<"\n"<<i;
}
Sum of first 10 numbers:
#include<iostream.h>
#include<conio.h>
void main()
{
int i, sum = 0;
clrscr();
for(i = 1; i < = 10; i++)
sum = sum + i;
cout<<"Sum is :"<<sum;
}
Enter 10 numbers and Print its sum:
#include<iostream.h>
#include<conio.h>void main()
{
int i, sum = 0, no;
clrscr();
for(i = 1; i < = 10; i++)
{
cout<<"Enter number :";
cin>>no;
sum = sum + no;
}
cout<<"Sum of 10 numbers is :"<<sum;
}