Social Icons

Friday, 23 August 2013

Java Program Using Scanner class to take Input from user

import java.util.Scanner;
class New
{
public static void main(String args[])
{
 Scanner s= new Scanner(System.in);
 System.out.println("Enter an integer value ");

 int a = s.nextInt();
 System.out.println("Enter 2nd integer");
 int b= s.nextInt();
 int c=a+b;
 System.out.println("Addition of two no. is "+c);
}


}


output:


      e:\java_programs>java New
Enter an integer value
25
Enter 2nd integer
36
Addition of two no. is 61

Full Duplex Mode Communication Using Pipe

#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/ipc.h>
#include<sys/types.h>
int main()
{
int p1[2],p2[2],i;
char buf[20];
pipe(p1);
pipe(p2);
if(fork()==0)
{
printf("\n this is child(the input text is text)\n");
close(p1[1]);
close(p2[0]);
read(p1[0],buf,20);
write(p2[1],"Hello Papa ! I m fine",25);
printf("\n Parent send the message : %s \n",buf);

}
else
{
printf("\n this is parent(the output text is text)\n");
close(p2[1]);
close(p1[0]);
write(p1[1],"how r u beta",20);

read(p2[0],buf,20);
printf("\n child sending message to parent : %s \n",buf);

}
return 0;
}


Output:
             

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.
 

Sample Text

Sample text

 
Just Programming Cse DriveReputation Management