Social Icons

Friday, 23 August 2013

Using Fork Command getting Process Id Of Child

#include<sys/types.h>
#include<stdio.h>
#include<stdlib.h>
int main()
{
int pid;
pid=fork();
if(pid==0)
{
printf("\n the process id of child is %d",getpid());
printf("\n the parent process id of child  is %d",getppid());
}

else
{
printf("\n the process id of parent is %d",getpid());
printf("\n the parent process id of parent  is %d",getppid());
}

return 0;

}

Thursday, 1 August 2013

How to increase bandwidth of your internet

Here's a simple little thing you can do to increase your bandwidth by at least 20%. 

Ok here we go,  

1.) log on as Administrator. 

2.) start - run - type gpedit.msc 

3.) expand "local computer policy" 

4.) then expand "administrative templates" 

5.) then expand "network branch" 

6.) Highlight/double click the "QoS Packet Scheduler" 

7.) on right window double click "limit reservable bandwidth" 

8.) on setting tab check the "enabled" 

9.) change "Bandwidth limit %" to 0 

You're done.It would be a good idea to reboot after this.


Why did we do that? Simple, Windows is silently eating 20% of your bandwidth. I emphasize on the word “silently” - Remember.

Saturday, 4 May 2013

Reversing a linked list inserted from begining


#include<iostream>
#include<conio.h>
using namespace std;
struct link
{
 int data;
 struct link *next;
 struct link *pre;
};
struct link *newn,*loc, *start,*ptr,*end;
void binsert();
void einsert();
void minsert();
void sinsert();
void reverse();
void display();
int main()
{char ch;
int op;
for(int i=0;i<5;i++)
{

 binsert();
 display();
}
cout<<"\n reverse of the linked list : ";
   reverse();
 
getch();
}


void display()
{
ptr=start;
while(ptr!=NULL)
{
cout<<" "<<ptr->data;
cout<<"-->";
ptr=ptr->next;
}
}



void binsert()
{
int item;
cout<<"\n Enter item to insert in begining :";
cin>>item;
newn = new struct link[1];
newn->data=item;
newn->next=NULL;
newn->pre=NULL;
//tr=start;
loc=end;
if(end==NULL)
{
start=newn;
end=newn;
}
else
{
while(loc->pre!=NULL)
{
loc=loc->pre;
}
 // newn->next=start;
loc->pre=newn;
  newn->next=loc;
  start=newn;




}

}

 void reverse()
 {
  loc=start;
  while(loc!=NULL)
  {
  cout<<" "<<loc->data;
cout<<"-->";
loc=loc->next;
 
  }
 }











Friday, 3 May 2013

Time Using Strftime Function


#include<unistd.h>
#include<time.h>
#include<stdio.h>
int main()
{
time_t t1,t2;
struct tm *tm_ptr;
int m,p,u;
char *n;
char buf[256];
time(&t1);

tm_ptr=localtime(&t1);

strftime(buf,256,"%A:%d:%B:%I:%S:%p",tm_ptr);
printf("\n time is %s",buf);

return 0;
}

 

Sample Text

Sample text

 
Just Programming Cse DriveReputation Management