NEWS: Total Picture Views: 147060 | Total Article Views: 155592 | Top 5 Most Popular Article: 1. Am I Stuck Algorithm with Becker Robot | 2. How to read a JSON and work with it | 3. PickUpThings with Becker Robot | 4. Encrypted Data GUI (Download .Zip) | 5. Create Wall and Things with Becker

Small Program Example Using Loop And Variable C

Description:

In this example I will be showing you a small program example using for loop and variable and print the result.

Code:

//Header
#include <stdio.h>
#include <string.h>
#include <math.h>

//Main Method
int main(int argc, char *argv[]){
	int i=0;
	char name[100] = "PROG20799";
	double result=0.0;
	//For Loop
	for(i=0;i<100;i++){
		result += sqrt(i);
	}
	//Print Statement
	printf("the code is: %s
", name);
	printf("the result is: %f
", result);
	//Must return a interger
	return 0;
}
Attachments: None

Tags: For loop Printf Include C

Total Views: 791

My name is Jean-Mathieu

I created this website so other people could enjoy finding useful stuff easier. If you have any question do not hesitate to contact me.

jean8mathieuCreated on 01/13/15 and updated on 01/16/15


affiliate_link

Disclosure: We are a website that needs compensation to operate like any other website on the internet.
We may receive consideration for our reviews but we are totally unbiased and do not accept paid reviews or fake reviews claiming to be something they are not.