Mar 30 2008

Saving the output of a C program in a text file(Linux/Unix)

Welcome to my blog :-) .If you’re new here, you may want to subscribe to my full RSS feed. Thanks for visiting!Consider the following c program

?View Code C1
2
3
4
5
6
7
8
9
10
#include<stdio.h>
main()
{
int i,n;
printf("Enter limit\n");
scanf("%d",&amp;n);
printf("I will print %d times\n",n);
for(i=0;i<n;i++)
printf("I luv C\n");
}

the output will be

Enter limit
4
I will print 4 times
I luv C
I luv C
I luv C
I luv C

This is a [...]