Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions

  




 

 

4.5. for

for is similar to while, it's just written differently. for statements are often used to proccess lists such a range of numbers:

Example 4-4. for_ten.c

#include <stdio.h>

int
main()
{
  int i;

  /* display the numbers from 0 to 9 */
  for (i = 0; i < 10; i++)
    printf("%d\n", i);

  return 0;
}
    

 
 
  Published under the terms of the GNU General Public License Design by Interspire