Friday, 17 July 2015

CURRICULuM -VITAE
Name:
mOB. NO. 

Career Objective



Personal Profile
Name                         :
Permanent Address: A/P    :
                               Tal    :
                               Dist    :
                               Pin    :                                                             

Mobile                     :
E-Mail Address           :
Date of Birth             :
Sex                       :   
Marital Status               :
Nationality                :
Languages known     :
Father’s Name          :

Educational Qualification

Qualification
University/Board
Month-Year
Percentage














Project
                  
        “        ”

Additional Courses

1.
2. 
3.


Elective Subject

1.
2.

Hobbies

1.
2.

         

I here by declare that the information given here with is correct to my knowledge and I will be responsible for any discrepancy.




Date:                                                       
Place:                                                                                                            (         Name         )
//program for create monthly Weather Report



#include<iostream>
using namespace std;
class weather
{
public:
int min_temp,max_temp,hum,cloud,day,sunlight;
string air,forec,month;
    weather()
    {
    min_temp=-99;
    max_temp=89;
    hum=78;
    forec="fog";
    air="cold";
    cloud=27;
    day=15;
    month="April";
    sunlight=9;
    }
    void getdata()
    {

    }
    void show()
    {
    cout<<"\nDate\t  Temperature\tForecast\tcloudly\t  Sunlight\tHumidity\n\t   Min   Max\n";
     for(int i=0;i<30;i++)
      {
    cout<<day<<" "<<month<<"   ";
    cout<<min_temp<<" C "<<max_temp<<" C"<<"     "<<forec<<"\t       "<<cloud<<"        "<<sunlight<<" hours\t     "<<hum<<"\t   \n";
       day++;
      }
    }
};
int main()
{
weather w;
w.show();
return 0;
}

/*

Output:-

Date      Temperature    Forecast    cloudly      Sunlight    Humidity
       Min   Max
15 April   -99 C 89 C     fog           27        9 hours         78      
16 April   -99 C 89 C     fog           27        9 hours         78      
17 April   -99 C 89 C     fog           27        9 hours         78      
18 April   -99 C 89 C     fog           27        9 hours         78      
19 April   -99 C 89 C     fog           27        9 hours         78      
20 April   -99 C 89 C     fog           27        9 hours         78      
21 April   -99 C 89 C     fog           27        9 hours         78      
22 April   -99 C 89 C     fog           27        9 hours         78      
23 April   -99 C 89 C     fog           27        9 hours         78      
24 April   -99 C 89 C     fog           27        9 hours         78      
25 April   -99 C 89 C     fog           27        9 hours         78      
26 April   -99 C 89 C     fog           27        9 hours         78      
27 April   -99 C 89 C     fog           27        9 hours         78      
28 April   -99 C 89 C     fog           27        9 hours         78      
29 April   -99 C 89 C     fog           27        9 hours         78      
30 April   -99 C 89 C     fog           27        9 hours         78      
31 April   -99 C 89 C     fog           27        9 hours         78      
32 April   -99 C 89 C     fog           27        9 hours         78      
33 April   -99 C 89 C     fog           27        9 hours         78      
34 April   -99 C 89 C     fog           27        9 hours         78      
35 April   -99 C 89 C     fog           27        9 hours         78      
36 April   -99 C 89 C     fog           27        9 hours         78      
37 April   -99 C 89 C     fog           27        9 hours         78      
38 April   -99 C 89 C     fog           27        9 hours         78      
39 April   -99 C 89 C     fog           27        9 hours         78      
40 April   -99 C 89 C     fog           27        9 hours         78      
41 April   -99 C 89 C     fog           27        9 hours         78      
42 April   -99 C 89 C     fog           27        9 hours         78      
43 April   -99 C 89 C     fog           27        9 hours         78      
44 April   -99 C 89 C     fog           27        9 hours         78      
cg-157@cg157:~/Desktop/kanchan/c++/output$


*/

Monday, 13 July 2015

 //c++ program to reverse string

#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<fcntl.h>
#include<errno.h>
#include<string.h>

void client(int);
void server(int);

int main()
{
  int pipe1[2];
  pid_t childpid;
  pipe(pipe1);
  childpid=fork();
  if(childpid==0)
 {

wait();
close(pipe1[1]);
server(pipe1[0]);
}
 
else

{

  close(pipe1[0]);
 client(pipe1[1]);
}
}

   void client(int writefd)
 {
   int len,n;
char buff[80];
printf("enter the string:\n");
fgets(buff,80,stdin);
len = strlen(buff);
if(buff[len-1]=='\n')
{
   len--;
}  
  write(writefd,buff,len);
}
void server(int readfd)
{
int fd,n,i,j;
char str[80],temp;
n=read(readfd,str,80);
str[n]='\0';
i=0;
j=strlen(str)-1;
while(i<j)
{
temp=str[i];
str[i]=str[j];
str[j]=temp;
i++;
j--;
}
printf("\nthe reverse of string:%s",str);
}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
 
//program for string reverse using pipe lines 

#include <iostream>
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>

using namespace std;

int main()
{
  int pid[2];
  ssize_t fbytes;
  pid_t childpid;
  char str[20], rev[20];
  char buf[20], red[20];

  pipe(pid);

  if ((childpid = fork()) == -1) {
    perror("Fork");
    return(1);
  }

  if (childpid == 0) {
    // child process close the input side of the pipe
    close(pid[0]);

    int i = -1, j = 0;
    while (str[++i] != '\0') {
      while(i >= 0) {
        rev[j++] = str[--i];
      }
      rev[j] = '\0';
    }

    // Send reversed string through the output side of pipe
    write(pid[1], rev, sizeof(rev));
    close(pid[0]);
    return(0);
  } else {
    cout << "Enter a String: ";
    cin.getline(str, 20);

    // Parent process closing the output side of pipe.
    close(pid[1]);

    // reading the string from the pipe
    fbytes = read(pid[0], buf, sizeof(buf));
    cout << "Reversed string: " << buf;
    close(pid[0]);
  }

  return 0;
}