473,396 Members | 1,826 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to use fork function

#include<stdio.h>
#include<math.h>

int a[50][50];
int b[50][50];
int c[50][50];
int i,j,m,n,p,q;

void main()
{

//clrscr();
printf("\n enter order of Anxn matrix: \n");
scanf("%d%d",&n,&m);
printf("\n enter order of Bnxn matrix: \n");
scanf("%d%d",&p,&q);
if(n!=p)
{
printf("\n additional is impossible \n");
}
else
{ printf("\n enter elements of matrix Anxn: \n");
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\n enter elements of matrix Bnxn: \n");
for(i=0;i<p;i++)
{
for(j=0;j<p;j++)
{
scanf(" %d",&b[i][j]);
}
}
printf("\n order of matrix C is %dx%d ",n,p);
for(i=0;i<n;i++)
{
for(j=0;j<p;j++)
{
c[i][j]=(a[i][j] + b[i][j]);
}
}
printf("\n\n matrix C is : \n");
for(i=0;i<n;i++)
{
for(j=0;j<p;j++)
{
printf(" %d\t",c[i][j]);
}
printf("\n");
}
}
getch();
}


//*this is my coding to find summation of two matrics. but now i have to write a program that call fork function and create 10 difference proccessor where each processor will display difference message.
//* i don't know how to solve it and plz help me!!!!!!
i have to submitted early!!!!!!!!!!!!!!
Sep 15 '08 #1
1 1626
gpraghuram
1,275 Expert 1GB
Whats your problem...do you want to call fork inside this code or you want to do something else?

raghu
Sep 15 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: C Gillespie | last post by:
Dear All, I have a function def printHello(): fp = open('file','w') fp.write('hello') fp.close() I would like to call that function using spawn or fork. My questions are:
2
by: CwK | last post by:
How to use fork() system function to fork multi child process at the same time ? For example: Run a program to fork 5 child process at the same time and the parent must wait until all child...
1
by: Gvs | last post by:
Hi, I'm just playing around with forking processes and was wondering how can you keep a child alive as long as the parent is alive. To give an example here is my code. ...
11
by: ramu | last post by:
Hi All, We know that a c function never returns more than one value. Then how come the fork() function returns two values? How it is implemented? Regards
1
by: vduber6er | last post by:
Hi I want to have a wait page while the rest of the cgi does its process, but it seems like the wait page waits till everything is complete and never appears. I've tried forking twice already as...
5
by: JoeW | last post by:
Now before I go into detail I just want to say that this is purely for my own benefit and has no real world usage. I remember way back when the tool for *nix systems called forkbomb was created. I...
1
by: ohaqqi | last post by:
Hi guys, I'm still working on my shell. I'm trying to implement a function typefile that will take a command line input as follows: > type <file1> This command will implement a catenation of...
4
by: rohitsagar | last post by:
I want to do fork from a program Code is very simple, below is the code, it just execute a executable called a.exe, I want to run a.exe 600 times. #include<stdio.h> #include<stdlib.h> void...
4
by: AK | last post by:
Hi everyone, Please check out this query that I have in : http://groups.google.com/group/progav/browse_thread/thread/29057ec587dd46b3 (its a bit long, thats why I am not typing it again;...
1
by: 3srt | last post by:
Hello, I created a simple 'server' script that will accept input from a cgi script. The server will handle multiple connections on the same port, also. In a nut shell, this 'server' script will...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.