Run C program in Linux


Hits: 1329  

This is the simple C file “svnlabs.c” to execute on linux terminal

#include

int main()
{
int i;
for(i=0;i<=5;i++)
{

printf(”n%d %s”,i,”svnlabs.com”);

}
printf(”n”);
return 0;
}

Output:

[root@localhost ~]# gcc svnlabs.c
[root@localhost ~]# make svnlabs
cc svnlabs.c -o svnlabs
[root@localhost ~]# ./svnlabs

0 svnlabs.com
1 svnlabs.com
2 svnlabs.com
3 svnlabs.com
4 svnlabs.com
5 svnlabs.com
[root@localhost ~]#

Published by

Sandeep Verma

I’m an Entrepreneur. I’m proud to work as Blogger, LAMP Programmer, Linux Admin, Web Consultant, Cloud Manager, Apps Developer, Searcher. Concentrate > Observe > Imagine > Launch

Leave a Reply

Your email address will not be published.

*