C program to calculate Simple Interest | Simple Interest program in C Language
In this post, We are going to discuss the Simple Interest program in C Language. Before writing the program, Here...
In this post, We are going to discuss the Simple Interest program in C Language. Before writing the program, Here...
Introduction: Write a C Program to find the largest of two numbers using the conditional operator in C Language. The...
Relational Operators example Program : #include<stdio.h> int main(void) { int a,b ; printf(“Enter values for a and...
Introduction: We have discussed the increment operators in our previous article, Here is another example to demonstrate the functionality of...
Description: In this program, We are going to find the roots of quadratic equation using a C program. We are...
Float Arithmetic Operations: Program Output: Related Articles: Arithmetic Operators with Examples. In Depth Analysis on Arithmetic Operators. Precedence and Associativity...
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...
Power function without Loops ( a^b ): Program Output:
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 /> |
Check Character Program : Write a C Program to Check character is alphabet or number or a special character. The...