-->

program to get sum of 1 to 10 natural numbers.

//program to get sum of 1 to 10 natural numbers.
#include<stdio.h>
#include<conio.h>
void main()
{
int k=1,sum=0;   //initialization
printf("enter value of 'n'\n");
scanf("%d",&n);
while(k<=n)
   {
      sum=sum+k;
      k++;
   }
printf("the sum=%d,",sum);
getch();
}

note:
here I have used 'n' as an input. We  can input any value, may be 10 or 20 or 100.
If you want to use 10 in loop directly then you can use and there would be no input(no scanf(..))

program to print/display 1,11,111,1111,11111,.... to nth term.

//program to print/display 1,11,111,1111,11111,.... to nth term.
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int k=1,m=1,n;
printf("enter value of 'n'\n");
scanf("%d",&n);
while(m<=n)
   {
      printf("%d\n",k);
      
      k=k+pow(10,m);
      m++;
   }
getch();
}

logic applied:

1,11,111,1111...
can be written as
1,10+1,100+11,1000+111....
can be written as
1,10 1+1,10 2+11,10 3+111
converting it into formula
k=k+pow(10,m);

program to print/display 1,6,11,16....nth term.

//program to print/display 1,6,11,16....nth term.
#include<stdio.h>
#include<conio.h>
void main()
{
int k=1,n;
printf("enter value of 'n'\n");
scanf("%d",&n);
while(k<=n)
   {
      printf("%d,",k);
      k=k+5;
   }
getch();
}

program to display multiplication table of a number .

//program to display multiplication table of a number .
#include<stdio.h>
#include<conio.h>
void main()
{
int k=1,n;
printf("enter value of 'n'(as a number)\n");
scanf("%d",&n);
while(k<=10)
   {
      printf("%d*%d=%d\n",n,k,n*k);
      k++;
   }
getch();
}
-------------------------------- note:
1)You can directly print instead given format.
put
printf("%d\n",n*k);

2) you can use nested loop for this as well.
 like
for(i=1;i<=1;i++)
  {
    for(k=1;k<=10;k++)
      {
          printf("%d\n",i*k);
       }
   }
you can put i =n if you enter this.
------------------------------------------------------------------------------
let's see the program using nested loop
//program to display multiplication table of a number using nested loop.
#include<stdio.h>
#include<conio.h>
void main()
{
int k,n;
printf("enter value of 'n'(a number for multiplication table)\n");
scanf("%d",&n);
for(i=n;i<=n;i++)
  {
    for(k=1;k<=10;k++)
      {
          printf("%d\n",i*k);
       }
          printf("\n");
   }
getch();
}
-----------------------------------------------------------------------------------------
let's see the program to get multiplication table of numbers using nested loop
//program to display multiplication table of  numbers using nested loop.
#include<stdio.h>
#include<conio.h>
void main()
{
int k,n;
printf("for how many numbers, you want t o go for multiplication table\n");
scanf("%d",&n);                       // from 1 to n
for(i=1;i<=n;i++)
  {
    for(k=1;k<=10;k++)
      {
          printf("%d\n",i*k);
       }
          printf("\n");
   }
getch();

}


program to print/display 2,4,6,8,10,12... to 15th term.

//program to print/display 2,4,6,8,10,12... to 15th term.

#include<stdio.h>
#include<conio.h>
void main()
{
int k=2;

while(k<=15)
   {
      printf("%d,",k);
      k=k+2;
   }
getch();
}

Or
you can use following method.

first term(a)=2
common difference(d)=2
number of terms(n)=15
here  we can see that given series is in arithmetic progression so nth term=a+(n-1)*d.It gives us nth term=30 i.e.
last term will be 30.
We put 30 in while loop

//program to print/display 2,4,6,8,10,12... to 15th term.
#include<stdio.h>
#include<conio.h>
void main()
{
int k=2;

while(k<=30)
   {
      printf("%d,",k);
      k=k+2;
   }
getch();
}


program to print/display 1,8,27... to 10th term.

//program to print/display 1,8,27... to 10th term.
#include<stdio.h>
#include<conio.h>
void main()
{
int k=1,n;

while(k<=10)
   {
      printf("%d,",k*k*k);
      k++;
   }
getch();
}

second method:
//program to print/display 1,8,27... to 10th term.
#include<stdio.h>
#include<conio.h>
#include<math.h>void main()
{
int k=1,n;

while(k<=10)
   {
      printf("%d,",pow(k,3);// it means get power 3 of k. pow() is  a function stored in 'math.h'
      k++;
   }
getch();
}


note:
If you want to display 'n' number of times then simply put
  int n;declare this.
printf("enter value of n\n");
scanf("%d",&n) 
put above two lines before while loop.

program to input your name and address and to display them 40 times.

//program  to input your name and address and to display them 40 times.
#include<stdio.h>
#include<conio.h>
void main()
{
char name[40],address[40];
int k=0;printf("enter your name\n");
gets(name);
printf("enter your address");
gets(address);
while(k<=40)
   {
      puts(name);
      puts(address);
      k++;
   }
getch();
}

note:
1)
     you can also use printf(  ) instead 'puts'.(without single quote)   and scanf("%^[\n]",name) instead 'gets' function.
2)
   If you want to display 'n' number of times then enter value of 'n' with its declaration.