Saturday, 18 June 2016

c code for pattern









































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

int main() {
char str[100];
    int i,j,len,spc,k;
    scanf("%s",str);
    len=strlen(str);
    spc=len;
    for(i=0,j=len-1;i<(len/2)&&j>(len/2);i++,j--){
        spc=spc-2;
        printf("%c",str[i]);
       for(k=1;k<=spc;k++)
            printf(" ");
        printf("%c\n",str[j]);
    }
   j++;
    i--;
    printf("%c\n",str[len/2]);
    for(;i>=0&&j<=len-1;i--,j++){
        printf("%c",str[i]);
        for(k=1;k<=spc;k++)
            printf(" ");
        printf("%c\n",str[j]);
        spc=spc+2;
    }
    /* Enter your code here. Read input from STDIN. Print output to STDOUT */   
    return 0;
}

என் கவிதை

என்  வாழ்க்கை ..

நாட்கள்  கழிகின்றன ...
    நிமிடங்கள்  ஓடுகின்றன ...
கனவுகள்  நிஜம்  ஆகையில் ...
   நிஜங்கள்  நினைவுகள் ஆகின்றன ...


Sine, Cosine and Tangent


c code for FLAMES

#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<malloc.h>
#include<stdio.h>

typedef struct flames
{
char c;
struct flames *next;
}flames;

char* relation(char ch);

void main(){

flames *head,*ne2,*ne3,*ne4,*ne5,*ne6,*temp,*p;
char *relate;
int f[6]={0,0,0,0,0,0},n,ch;
      char n1[100],n2[100];
      clrscr();
     cin>>n1;
     cin>>n2;
      int l1,l2;
      l1=strlen(n1);
      l2=strlen(n2);
      int i,j;
      for(i=l1-1;i>=0;i--)
      {
     if(n1[i]!='\0')
     {
     for(j=l2-1;j>=0;j--)
     {
    if(n2[j]!='\0')
    {
         if(n1[i]==n2[j])
         {
      n1[i]=n2[j]='\0';
      break;
         }
    }

     }
     }
      }
      int count=0;
      for(i=0;i<l1;i++)
      {
         if(n1[i]!='\0')
   count=count+1;
      }
      for(j=0;j<l2;j++)
      {
         if(n2[j]!='\0')
    count=count+1;
      }
cout<<"count is "<<count;

printf("\n\nLetters left are %d",count);


//delay(100);
printf("\nchecking for F L A M E S..............\n\n");

///////////////////////////////////////////////////////////
/*Creating CLL for flames*/

head=(struct flames*)malloc(sizeof(struct flames));
ne2=(struct flames*)malloc(sizeof(struct flames));
ne3=(struct flames*)malloc(sizeof(struct flames));
ne4=(struct flames*)malloc(sizeof(struct flames));
ne5=(struct flames*)malloc(sizeof(struct flames));
ne6=(struct flames*)malloc(sizeof(struct flames));

head->c='f'; head->next=ne2;
ne2->c='l'; ne2->next=ne3;
ne3->c='a'; ne3->next=ne4;
ne4->c='m'; ne4->next=ne5;
ne5->c='e'; ne5->next=ne6;
ne6->c='s'; ne6->next=head;
/////displaying CLL
temp=head;
i=0;
while(i<6)
{
printf(" %c",temp->c-32);
temp=temp->next;
i++;
}
printf("\n");

temp=head;
int m=0;
while(m<5)
{
for(i=0;i<count-2;i++)
temp=temp->next;
printf("\nDeleting %c",temp->next->c);
p=temp->next;
temp->next=temp->next->next;
temp=temp->next;
free(p);
m++;
}
ch=temp->c;

printf("\n\tSo.....The Relation is :::::: ");
relate=relation(ch);

//delay(500);
puts(relate);
printf("\n\n");
getch();
}

char* relation(char ch)
{
char *rel;

switch(ch)
{
case 'f':
return rel="FRIENDSHIP";


case 'l':
return rel="LOVE";


case 'a':
return rel="ATTRACTION";


case 'm':
return rel="MARRIAGE";


case 'e':
return rel="ENEMY";


case 's':
return rel="SISTER";
}
}

c code for beep sound

#include <stdlib.h>
#include <stdio.h>
 
int main (void)
{
 
   char beep = '\007';
    
   printf("%c", beep);
 
    return EXIT_SUCCESS;
}

Friday, 17 June 2016

Deficit to Appreciative




Be a positive communicator

To be a more positive communicator 

    Think before you speak or act. Don’t just react! Pause and take a minute to think about how you want to respond in an accountable way. 


    Keep an open mind. Don’t jump to conclusions. Every story has two sides to it and somewhere in the middle you’ll find the truth. 

    Discuss rather than argue. Use your active listening skills and shovel any piles that need shoveling. Deal with the issues you need to deal with and be tender on the person and tough on the issue!


   Cultivate a soothing voice. Remember, the tone of your voice means more than what you say. Watch your body language. Keep your body open and relaxed. 


   Never lose an opportunity to praise or say a kind word. Say something nice to someone. Look for what is good and say something about it. 


   Exceed expectations. Always go the extra mile and do more than is expected of you. Better yet, do it with a smile.

   Learn to be objective about personal criticism. Don’t spend time worrying about things you have no control over. Be true to yourself.

   Respect the feelings of others. Treat others the way you believe they would like to be treated. 

   Refuse to discuss the shortcomings of others. Discourage gossip. Gossip does not do anyone any good. We all know that, so why do we do it? Try making a good and positive comment for every gossipy one you hear. 

  Let your virtues speak for themselves. Dust off those communication skills you know, but don’t always use to work toward better communication and understanding. 

So, step back and think about how you will communicate in a more positive way.  When you encourage positive communication within yourself, people will follow your lead and you will encourage others to do the same!

Complexity2


Complexity1

Zoho interview question


Problem statement:
Given an m x n matrix, find all common elements present
in all rows in O(mn) time and one traversal of matrix.

Example:
Input:
mat[4][5] = {{1, 2, 1, 4, 8},
             {3, 7, 8, 5, 1},
             {8, 7, 7, 3, 1},
             {8, 1, 2, 7, 9}};

Output:
1 8 or 8 1
8 and 1 are present in all rows

solution:

#include<stdio.h>
int main(){
int arr[5][5];
int c=0,row=5,col=5,i=0,j=0,k=1,l=0;
for(i=0;i<row;i++)
for(j=0;j<col;j++)
scanf("%d",&arr[i][j]);
for(j=0;j<col;j++){
 for(k=1;k<row;k++){
  for(l=0;l<col;l++){
   if(arr[0][j]==arr[k][l]){
    c++;  
    arr[k][l]=0;
    break;
   }
  }
 }
 if(c==row-1)
  printf("%d ",arr[0][j]);
 c=0;
}
return 0;
}

Tuesday, 14 June 2016

Puzzle

Think logically..

7x+y+4z=365
 what is the value of x,y and z?


 4 months has 30 days. 7 months has 31 days.
so
(7*31)+28+(4*30)=365

answer: x=31, y=28,z=30




World CodeSprint #4

Join World CodeSprint #4 to prove your coding skills, win $15,000 in cash prizes and get job opportunities.

On Sat. June 25th, you’ll have 24 hours to solve 8 algorithm code challenges. Rocket Fuel and other companies will contact top competitors who are interested in job opportunities. Learn more here.

Top 100 coders will win $15,000 in prizes:
- 1st place wins $2,000 Amazon Gift Card
- 2nd place wins $1,000 Amazon Gift Card
- 3rd place wins $750 Amazon Gift Card
- 4th - 100th places win $75 Amazon Gift Card  
- Top 100 places win World Champion Shirt

Get your code on and sign up now so you don’t miss out!

Thursday, 9 June 2016

Positive Communication

“I don’t know”

Situation

A customer asks if the price for the vacation includes the transfer from the hotel to the beach. Here’s what you can answer:
  1. I don’t know, I don’t think so.
  2. Good question, let me find out that for you right now!
It might sound harsh but customers needs are more important than your current situation. Let them know that it doesn’t matter that you don’t know the answer right now, because you’ll do whatever you can to find out as soon as you can.

“I can’t…”


Situation

A customer comes to you with a new case which you have no idea how to solve. Depending on what you will think, your answer will differ. Here’s what you can say:
  1. I can’t solve this case
  2. I can learn to solve it.
Isn’t option B uplifting? By taking the positive attitude in this situation, whatever you will say to the client will have a positive undertone. It’s the “I can do anything” attitude and it makes you believe that you can solve the case. Customers can sense it and they will feel secure and relaxed. On the other hand, the first option makes customers become stressed along with you.

“It’s not available right now”


Situation

A customer asks for a product that is not in stock. You can answer:
  1. We don’t have this item and it won’t be available for about 2 weeks, until the next supply.
  2. This product will be available within two weeks. I can place your order and make sure it will be sent to you as soon as it gets to us.
Instead of using words like “I can’t get that for you”, “it’s not available”, provide the closest alternative. Think about solutions because that’s what customers are interested to hear.

Thursday, 2 June 2016

என் அன்பு ...

உன்னை  தனிமையில்  தவிக்க விடவில்லை..
             நான்  தனியாக   தவிக்கின்றேன் ...
தனிமையும்  சுகம்தானே ...
             உன்  நினைவுகளுடன்  இருக்கையில் ...

தாலாட்டு  பாட  தாயும்  அல்ல..
            தாங்கிப்பிடிக்க  தந்தையும்  அல்ல..
அணைத்துக்கொள்ள  அக்காவும்  அல்ல ..
           அறிவுரைச்சொல்ல  அண்ணனும்  அல்ல..

உன்  உறவென்று கூறி ..
           என்  உறவை  முடித்துக்கொள்ள  விரும்பவில்லை...

நான்  காற்றுப்போல  இருப்பேன் ...
           காலம்  முழுதும்  நீ  சுவாசிக்க ...