print 1 to 4 using while loop in C Programming

C Programming Language Loop control in C Language (Article) Loop control in C Language (Program)

1634

Program:

#include <stdio.h>
int main()
{
   int count=1;
   while (count <= 4)
   {
	printf("%d ", count);
	count++;
   }
   return 0;
}

Output:

1 2 3 4

Explanation:

A while loop in C programming repeatedly executes a target statement as long as a given condition is true.

This Particular section is dedicated to Programs only. If you want learn more about C Programming Language. Then you can visit below links to get more depth on this subject.