Write a C program to generate the first n terms of the sequence. | Fibonacci Sequence program in C
What is Fibonacci Series : A Fibonacci Sequence is defined as follows:...
What is Fibonacci Series : A Fibonacci Sequence is defined as follows:...
Headers.h file contains this headers.. Instead of writing all headers in Every program i am maintaining one file for headers...
C codes / In Depth Programs / IPC / Linux / Uncategorized
Pipe(Inter process Communication Event) Implementation in C Language :
1 |
#include"headers.h"<br />main()<br />{<br /> int p[2];int size,st;<br /> char buf[1000];<br /> bzero(buf,1000);<br /> pipe(p);<br /> printf("%d and %d are created by pipe..n",p[0],p[1]);<br /> int chldpid;<br /><br /> if((chldpid = fork()))<br /> {//client... parent...<br /> char file[20];<br /> printf("Enter File Name ..:");<br /> scanf("%s",file);<br /> size = strlen(file);<br /> write(p[1],&size,4);<br /> write(p[1],file,size);<br /> wait(&st);<br /> read(p[0],&size,4);<br /> read(p[0],buf,size);<br /> write(1,buf,size);<br /> }<br /> else<br /> {//child ... server ...<br /> int s,fd;<br /> int s2;<br /> read(p[0],&s,4);<br /> printf("Size in child ..%d n",s);<br /> char fname[20],*buff;<br /> bzero(fname,20);<br /> read(p[0],fname,s);<br /> printf("In child file name :%s..n",fname);<br /> fd=open(fname,O_RDONLY);<br /> if(fd &lt 0)<br /> {<br /> s2 = 26;<br /> write(1,"open failed..n",15);<br /> write(p[1],&s2,4);<br /> write(p[1],"Error File Doesn't Exist..",26);<br /> }<br /> else<br /> {<br /> s2 = lseek(fd,0,SEEK_END);<br /> buff =(char *) malloc(s2+1);<br /> lseek(fd,0,SEEK_SET);<br /> read(fd,buff,s2);<br /> close(fd);<br /> write(p[1],&s2,4);<br /> write(p[1],buff,s2);<br /> }<br /> exit(0);<br /> }<br /><br />}<br /> |
Datatypes List in C language : Data Type Format Specifiers Size Range Signed char %c 1Byte -128 to 127 Unsigned...
C programs are collection of Statements, statements is...
Introduction: We have discussed about the Identifier in C and rules for naming the Identifiers in our Previous article, In...
Introduction: In our previous article, We have looked at the Operators and different types of Operators in C language. In...
SIP / Sip Basics / Uncategorized / VOIP
SIP Protocol : SIP protocol is an application Layer protocol, used to Establish and modify and Terminate Multimedia sessions. These...
Dr APJ Abdul Kalam quote The Great Tree in My home: The Great Tree in My Home Poem: Oh...