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 [...]

Mar 23 2008

Important instructions for programs using math.h library function

if your program uses math.h header file then sometimes the compilation will lead to errors.In such cases you have to suffix -lm to the compilation file command
Usage

cc filename.c -lm

lm means link mathematical header file.Note that this step is not always required use it only if your program is correct and compilation is leading to errors.
and [...]

Mar 22 2008

Advantages of running c in Linux/Unix-1

C is strongly linked with linux/unix .The kernel of Unix/Linux is written in C.Running C in linux/unit has several advantages .The most important among it is full word length utilization.
Consider the following C program

[-]?View Code C1
2
3
4
5
6
7
8
9
#include<stdio.h>
int main()
{
int a;
float b;
printf("Size of int datatype =%d bits\n",(sizeof(a)*8));
printf("Size of float datatype =%d bits\n",(sizeof(b)*8));
return 1;
}

Mar 22 2008

C in linux/unix-First step

First let’s learn how to run a c program in linux/unix.Nearly every distro support’s running c programs.
First thing is to type the c program.you can use any editor you want but here i use vi editor which comes with allmost all distro
vi editor
To create a new c file or to open an existing [...]

Feb 20 2008

ASCII Chart

After seeing this chart if you want to print say square root symbol all you have to do is specify the ASCII value for %c in printf
i.e to print square root..
printf(”%c Hi! %c”,251,251);
and to print heart symbol
printf(”%c Hi! %c”,3,3);

Page 1 of 3123»

Shout at me :p

Last Message 1 week ago
1 guest is online.
  • Info : Please, resolve the addition below before post any new comment...
  • test45355243 : 3535435
  • test5q552525325243 : 35435435
  • test5q5525253252 : 2554325
  • test5q55252 : 5525235
  • test5q5 : q5q5
  • test : 5w5
  • Orwykzge : Wonderfull great site <a href=" «link» ">sex freaks xxx</a> >:PPP
  • Pierre : Your shoutbox is blank. Add a message!

What I'm Doing...

Posting tweet...