Wednesday 7 June 2017

RIGHT AND LEFT SHIFT

RIGHT SHIFT:

Shift one bit to the left;

Ex;

N=1000=8
>>1=0100

2^1*N=RIGHT SHIFT
N=number
1=shift value that is how many time shift

LEFT SHIFT:


shift one bit to right

Ex:

N=0101=5
1<<=1010

N/2^1=LEFT SHIFT
N=number
1=shift value that is how many time shift

Friday 3 March 2017

இந்தியாவில் சாதனை படைத்த முதல் பெண்கள்

* முதல் பெண் குடியரசுத் தலைவர் - பிரதீபா பாட்டில் 2007
* முதல் மத்திய அமைச்சர் - ராஜ்குமாரி அம்ருதா கவுர் (1947 - 57)
* முதல் பெண் ஆளுநர் - சரோஜினி நாயுடு (1947 - 1949)
* மாநிலங்களவை முதல் பெண் பேரவை துணைத் தலைவர் - வயலட் ஆல்வா
 முதல் பெண் முதல்வர் (உத்திரப்பிரதேசம்) - சுசேதா கிருபளானி (1963 - 1967)
* குடியரசுத் தலைவர் தேர்தலில் போட்டியிட்ட முதல் பெண்மணி - மனோகர நிர்மலா ஹோல்கர் (1967)
* முதல் பெண்  அய்ஏஎஸ் அதிகாரி - அன்னா ராஜன் ஜார்ஜ்
* மக்களவை முதல் பெண் பேரவைத் தலைவர் - மீரா குமார் (2009)
* மகசேசே விருது பெற்ற முதல் பெண்மணி  - அன்னை தெரசா (1962)
* இந்திய தேசிய காங்கிரசின் தலைவரான முதல் பெண்மணி - அன்னிபெசன்ட் (1917)
* காங்கிரஸ் தலைவரான முதல் பெண்மணி - சரோஜினி நாயுடு (1925)
* ஏர்மார்ஷல் பதவி வகித்த முதல் பெண்மணி - பத்மாவதி பந்தோ பாத்யாயா (2004)
* பால்கே விருது பெற்ற முதல் நடிகை - தேவிகா ராணி ரோரிச் (1969)
* புக்கர் பரிசு பெற்ற முதல் எழுத்தாளர்  - அருந்ததி ராய் (1997)
* மிஸ்வேர்ல்ட் பட்டம் பெற்ற முதல் பெண்மணி - ரீத்தா ஃபரியா பவல் (1966)
* மிஸ்யூனிவர்ஸ் பட்டம் பெற்ற முதல் பெண்மணி - சுஷ்மிதா சென் (1994)
* பாரத ரத்னா விருது பெற்ற முதல் பெண்மணி - இந்திராகாந்தி (1971)
* ஆஸ்கார் விருது பெற்ற ஒரே பெண்மணி - பானு அதய்யா
*  முதல் பெண் பிரதமர் - இந்திரா காந்தி (1966)
* உச்சநீதிமன்றத்தின் முதல் பெண் நீதிபதி - எம்.பாத்திமா பீவி (1989)
* உயர்நீதிமன்றத்தின் முதல் பெண் நீதிபதி - (கேரளா) அன்னா சாண்டி (1959)
* உயர்நீதிமன்றத்தின் முதல் பெண் தலைமை நீதிபதி - (இமாச்சல்) - லீலா சேத் (1991)
* அய்.நா. பொதுச்சபையின் முதல் பெண் தலைவர் - விஜயலட்சுமி பண்டிட்
* முதல் பெண் அய்பிஎஸ் - கிரண்பேடி (1972)
* விண்வெளி சென்ற முதல் பெண்மணி - கல்பனா சாவ்லா
* எவரஸ்டில் ஏறிய முதல் பெண்மணி - பச்சேந்திரி பால்
* ஆங்கிலக் கால்வாயை நீந்திக் கடந்த முதல் பெண்மணி - சுரதி ஸாஹா
* ஏழு வளைகுடாக்களை நீந்திக் கடந்த முதல் பெண்மணி - பிலா சவுத்ரி
* ஞானபீட விருது பெற்ற முதல் பெண்மணி - ஆஷாபூர்ணா தேவி (1976)
* ஒலிம்பிக் போட்டியில் போட்டியிட்ட முதல் பெண்மணி - நீலிமா கோஷ் (1952)
* லெப்டினன்ட் ஜெனரல் பதவி வகித்த முதல் பெண்மணி - புனிதா அரோரா (2004)

Monday 27 February 2017

ஐந்து வகை நிலம் - (ஐவகை நிலம்)

  • மலையும் மலை சார்ந்த இடமும் குறிஞ்சித் திணை
  • காடும், காடு சார்ந்த நிலமும் முல்லைத் திணை
  • இவையிரண்டுக்கும் இடையில் அமைந்த பாழ் நிலம் பாலை எனப்பட்டது.
  • வயலும் வயல் சார்ந்த நிலமும் மருதம் எனவும்,
  • கடலும் கடல் சார்ந்த இடம் நெய்தல் எனவும் அழைக்கப்பட்டன.



திணைஉரிப்பொருள்விளக்கம்
குறிஞ்சிபுணர்தலும், புணர்தல் நிமித்தமும்ஆண் பெண் உடலுறவு
முல்லை(பிரிவை மனத்தில் ஆற்றிக்கொண்டு) இருத்தலும், இருத்தல் நிமித்தமும் * ஆனிரையோடு மீளும் வரையில் பிரிவை மனத்தில் ஆற்றிக்கொண்டு இருத்தலும், இருத்தல் நிமித்தமும். இது நிலத்தியல்பு. * பொருள் தேடச் சென்றவர் மீளும் வரையில் (பிரிவை மனத்தில் ஆற்றிக்கொண்டு) இருத்தலும், இருத்தல் நிமித்தமும். இது வாழ்க்கை இயல்பு * போருக்குச் சென்றவர் மீளும் வரையில் பிரிவை மனத்தில் ஆற்றிக்கொண்டு இருத்தலும், இருத்தல் நிமித்தமும். இது நாட்டின் இயல்பு * ஓதல் முதலான பிற பிற பிரிவுகளையும் இங்கு எண்ணிக்கொள்ள வேண்டும். ஒதற்பிரிவு என்பது கல்வி கற்கச் செல்லுதல்.புறப்பொருள் நிமித்தம் பிரிந்த தலைவன் வருகைக்காகத் தலைவி காத்திருத்தல்
மருதம்ஊடலும், ஊடல் நிமித்தமும்.அகவொழுக்கப் பிரிவு * வேறொருத்தியோடு வாழ்ந்த தலைவனிடம் தலைவி பிணக்கிக்கொள்ளுதல்
நெய்தல்இரங்கலும் இரங்கல் நிமித்தமும்.முல்லை நிலத்தில் கணவன் திரும்பி வருவது உறுதி என்பதனால் ஆற்றிக்கொண்டு இருத்தல் உரிப்பொருள் ஆயிற்று * கடலுக்குள் மீன் பிடிக்கச் செல்வோரது நிலை அதுவன்று. எனவே மனைவி கவலைப்படுவது இரங்கலாயிற்று.
பாலைபிரிதலும், பிரிதல் நிமித்தமும்
பொருள், போர், கல்வி முதலான புறப்பொருள் நிமித்தம் தலைவன் பிரிதலும், தலைவி வாடுதலும்



சிறுபொழுதுமணி (24 மணி கணக்கீடு)(60 நாழிகை என்பது ஒரு நாள்) (24 நிமிடம் என்பது ஒரு நாழிகை)
காலை6 முதல் 10 மணி
நண்பகல்10 முதல் 14 மணி
எற்பாடு14 முதல் 18 மணி
மாலை18 முதல் 22 மணி
யாமம்22 முதல் 2 மணி
வைகறை2 முதல் 6 மணி
பெரும்பொழுதுகால எல்லையைக் குறிக்கும் வழக்கிலுள்ள தமிழ்மாதப் பெயர்கள்
இளவேனில்சித்திரை, வைகாசி
முதுவேனில்ஆனி, ஆடி
கார்ஆவணி, புரட்டாசி
கூதிர் (குளிர்)ஐப்பசி, கார்த்திகை
முன்பனிமார்கழி, தை
பின்பனிமாசி, பங்குனி
திணைபெரும்பொழுதுசிறுபொழுதுதொல்காப்பிய நூற்பா
குறிஞ்சிகூதிர், முன்பனியாமம்952
முல்லைகார், முன்பனிமாலை952
மருதம்-வைகறையாகிய விடியல்954
நெய்தல்-எற்பாடு (ஏற்பாடு)954
பாலை (நடுவுநிலைத் திணை)இளவேனில், முதுவேனில், பின்பனிநண்பகல்955, 956

வ.

ண்
திணை
முதற்பொருள்
கருப்-
பொருள்கள்
சில
உரிப் பொருள்-
கள்
நிலம்
பொழுது



1.

குறிஞ்சி

மலையும்
மலை
சார்ந்த
நிலமும்
சிறு
பொழுது

நள்ளிரவு
பெரும்
பொழுது

குளிர்காலம்

முருகன்,
குறவன்,
கிளி,
மயில்,
புலி,
அருவிநீர்,
சந்தன
மரம்,
தினை
அரிசி,
வெறியாடல்

புணர்தலும்
புணர்தல்
நிமித்தமும்
(நிமித்தம்=
காரணம்;
புணர்தல்
=
ஒன்று
சேர்தல்)

2.

முல்லை

காடும்
காடு
சார்ந்த
நிலமும்

மாலை

மழைக்
காலம்

திருமால்,
ஆயர்,
காட்டுக்
கோழி,
மான்,
முயல்,
காட்டாறு,
ஆடு,
வரகு,
குழலூதுதல்,
ஏறு தழுவுதல்.

இருத்தலும்
இருத்தல்
நிமித்தமும்
(இருத்தல்=
பிரிவைப்
பொறுத்து
இருத்தல்)

3.

மருதம்

வயலும்
வயல்
சார்ந்த
நிலமும்

வைகறை

கார்காலம்
முதலான
எல்லாக்
காலமும்
உரியது.

இந்திரன்,
உழவன்,
அன்னம்,
எருமை,
ஆறு,
கிணறு,
தாமரை,
நெல்.
அரிசி,
உழவு.

ஊடலும்
ஊடல்
நிமித்தமும்
(ஊடல்=
தலைவி,
தலைவன்
மீது கோபம்
கொள்-
ளுதல்)

4.

நெய்தல்

கடலும்
கடல்
சார்ந்த
பகுதியும்

பிற்பகல்
(சூரியன்
மறையும்
நேரம்)

கார்காலம்
முதலான
எல்லாக்
காலமும்
உரியது.

வருணன்,
பரதவர்,
கடற்காகம்,
சுறா மீன்,
பாக்கம்,
உவர்நீர்க்
கேணி,
தாழைமலர்,
மீனும்
உப்பும்
விற்றல்,
கடல்
ஆடல்.

இரங்கலும்
இரங்கல்
நிமித்தமும்
(இரங்கல்=
பிரிவு
தாங்காது
தலைவி
வருந்துதல்)

5.

பாலை

வறண்ட
மணற்
பகுதி
மணலும்
மணல்
சார்ந்த
பகுதி-
யும்.

நண்பகல்

வேனிற்
காலம்

கொற்றவை,
எயினர்,
மறவர்,
புறா,
பருந்து,
செந்நாய்,
குராசு மலர்,
வழிப்பறி,
பகற் சூறை.

பிரிதலும்
பிரிதல்
நிமித்தமும்
(பிரிதல்=
தலைவன்
தலைவியைப்
பிரிதல்)
பிரிவும்
அதை
ஒட்டிய
செயல்பாடு-
களும்

OSCAR AWARD WINNERS IN INDIA

Bhanu Athaiya


Category: Best Costume Design
Movie: Gandhi (1982)
Bhanu Athaiya is the first Indian who won the Academy Award in the year 1982. She has worked with many big names like Yash Chopra, Guru Dutt, Ashutosh Gowarikar and Raj Kapoor. She won the Oscar for Best Costume Design for her work in the Ben Kingsley starrer Gandhi. Jon Mollo also shared the award with her.

atyajit Ray

Category: Lifetime Achievement Award (1992)
Satyajit Ray is considered as one of the greatest directors in Indian (especially Bengali) cinema. He is known all around the world for his dedication and passion for movies. He was awarded the Lifetime Achievement award in the year 1992. He could not attend the ceremony to accept the award due to his illness and he was in hospital during that time. Although, he gave his award acceptance speed through a live video feed from the hospital bed.

A.R. Rahman

Categories: Best Original Song (Jai Ho) and Best Original Score
Movie: Slumdog Millionaire (2008)
A.R. Rahman is the only Indian who has won Oscar not once but, twice. The music maestro shared the Best Original Score award with Gulzar for his song “Jai Ho”. He went on to grab his first individual and the second Oscar when he won in the category of Best Original Score for the very same movie “Slumdog Millionaire”. Rahman made the award ceremony memorable when he said, “Mere paas maa hai” to thank his mother for the award.

Resul Pookutty

Category: Best Sound Mixing
Movie: Slumdog Millionaire (2008)
Slumdog Millionaire is the reason for half of the Oscar wins for India. Resul Pookutty shared the award for Best Sound Mixing with Ian Tapp and Richard Pryke. He won the award for his contribution in the movie Slumdog Millionaire. He has worked in the field of sound designing, sound editing and mixing.

Gulzar

Category: Best Original Song (Jai Ho)
Movie: Slumdog Millionaire (2008)
The legendary composer and singer shared the award of Best Original Song for the song “Jai Ho”. Gulzar wrote the lyrics for the song which became a sensation all over world. However, Gulzar was not there at the ceremony to receive the award. Gulzar has penned down many famous songs for many Bollywood movies.


































Saturday 28 January 2017

My Programs

1.QUESTION:
Consider a staircase of size :
   #
  ##
 ###
####
Observe that its base and height are both equal to , and the image is drawn using # symbols and spaces. The last line is not preceded by any spaces.
Write a program that prints a staircase of size .
SOLUTION:
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

int main() {
    int n,i,j,k;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
        {
        for(j=n-1;j>=i;j--)
            printf(" ");
                for(k=1;k<=i;k++)
                    printf("#");
           printf("\n");   
}
    return 0;
}
2.QUESTION:

Given five positive integers, find the minimum and maximum values that can be calculated by summing exactly four of the five integers. Then print the respective minimum and maximum values as a single line of two space-separated long integers.

SOLUTION:

#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>

int main(){
   long long int a1,a; 
   long long int b1,b; 
    long long int c1,c; 
    long long int d1,d;
    long long int e1,e;
    scanf("%lld %lld %lld %lld %lld",&a1,&b1,&c1,&d1,&e1);
    a=b1+c1+d1+e1;
    b=a1+c1+d1+e1;
    c=b1+a1+d1+e1;
    d=b1+c1+a1+e1;
    e=b1+c1+d1+a1;
    if(a==b&&b==c&&c==d&&d==e)
        printf("%lld %lld",a,b);
    else
        {
          if((a<b&&a<c&&a<d&&a<e))
        printf("%lld ",a);
         else if((b<a&&b<c&&b<d&&b<e))
        printf("%lld ",b);
          else if((c<a&&c<b&&c<d&&c<e))
        printf("%lld ",c);
          else  if((d<b&&d<c&&d<a&&d<e))
        printf("%lld ",d);
         else if((e<b&&e<c&&e<d&&e<a))
        printf("%lld ",e);
             
               if((a>b&&a>c&&a>d&&a>e))
        printf("%lld ",a);
   
     else if((b>a&&b>c&&b>d&&b>e))
        printf("%lld ",b);
   
    else if((c>a&&c>b&&c>d&&c>e))
        printf("%lld ",c);
   
   else if((d>b&&d>c&&d>a&&d>e))
        printf("%lld ",d);
  
      else if((e>b&&e>c&&e>d&&e>a))
        printf("%lld ",e);
   
             }
    return 0;

}

3.QUESTION
Sam's house has an apple tree and an orange tree that yield an abundance of fruit. In the diagram below, the red region denotes his house, where  is the start point and  is the end point. The apple tree is to the left of his house, and the orange tree is to its right. You can assume the trees are located on a single point, where the apple tree is at point  and the orange tree is at point .
Apple and orange(2).png
When a fruit falls from its tree, it lands  units of distance from its tree of origin along the -axis. A negative value of  means the fruit fell  units to the tree's left, and a positive value of  means it falls  units to the tree's right.

Given the value of  for  apples and  oranges, can you determine how many apples and oranges will fall on Sam's house (i.e., in the inclusive range )? Print the number of apples that fall on Sam's house as your first line of output, then print the number of oranges that fall on Sam's house as your second line of output.
SOLUTION
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>

int main(){
    int s; 
    int t; 
    scanf("%d %d",&s,&t);
    int a; 
    int b; 
    scanf("%d %d",&a,&b);
    int m; 
    int n; 
    scanf("%d %d",&m,&n);
    int *apple = malloc(sizeof(int) * m);
    for(int apple_i = 0; apple_i < m; apple_i++){
       scanf("%d",&apple[apple_i]);
    }
    int *orange = malloc(sizeof(int) * n);
    for(int orange_i = 0; orange_i < n; orange_i++){
       scanf("%d",&orange[orange_i]);
    }
    int i,x,c=0,y,c1=0;
    for(i=0;i<m;i++)
        {
        x=apple[i]+a;
        if(x>=s&&x<=t)
            c++;
    }
    for(i=0;i<n;i++)
        {
        y=b+orange[i];
        if(y<=t&&y>=s)
            c1++;
    }
    printf("%d\n%d",c,c1);
    return 0;
}
4.QUESTION
There are two kangaroos on an x-axis ready to jump in the positive direction (i.e, toward positive infinity). The first kangaroo starts at location  and moves at a rate of  meters per jump. The second kangaroo starts at location  and moves at a rate of  meters per jump. Given the starting locations and movement rates for each kangaroo, can you determine if they'll ever land at the same location at the same time?
SOLUTION
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>

int main(){
    int x1; 
    int v1; 
    int x2; 
    int v2,f=2; 
    scanf("%d %d %d %d",&x1,&v1,&x2,&v2);
       while(1)
           {
           x1=x1+v1;
           x2=x2+v2;
           if(x1==x2)
               {
               f=1;
               break;
           }
           else if(x1>x2){
               f=0;
               break;
           }
         }
            if(f==0) 
            printf("NO");
        else
             printf("YES");
    return 0;
}
5.QUESTION
You are given an array of  integers, , and a positive integer, . Find and print the number of  pairs where  and  +  is evenly divisible by .

SOLUTION
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>

int main(){
    int i,j,n; 
    int k,c=0,a[100000]; 
    scanf("%d %d",&n,&k);
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
     for(i=0;i<n;i++)
         {
          for(j=i+1;j<n;j++)
              {
              int t=a[i]+a[j];
              if(t%k==0)
                  {
                  c++;
                  //printf("%d %d \n",i,j);
              }
          }
     }
    printf("%d",c);
    return 0;
}
6.QUESTION
Anna and Brian order  items at a restaurant, but Anna declines to eat any of the  item (where ) due to an allergy. When the check comes, they decide to split the cost of all the items they shared; however, Brian may have forgotten that they didn't split the  item and accidentally charged Anna for it.
You are given , the cost of each of the  items, and the total amount of money that Brian charged Anna for her portion of the bill. If the bill is fairly split, print Bon Appetit; otherwise, print the amount of money that Brian must refund to Anna.
SOLUTION
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
    int n,p,t,s=0,i;
    cin>>n>>p;
    int a[n];
    for(i=0;i<n;i++){
        cin>>a[i];
        s=s+a[i];
    }
    cin>>t;
    int x=s-a[p];
    int y=x/2;
    if(t>y)
        cout<<t-y;
    else
        cout<<"Bon Appetit";
        
    return 0;
}
7.QUESTION
John's clothing store has a pile of  loose socks where each sock  is labeled with an integer, , denoting its color. He wants to sell as many socks as possible, but his customers will only buy them in matching pairs. Two socks,  and , are a single matching pair if .
Given  and the color of each sock, how many pairs of socks can John sell?
SOLUTION
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>

int main(){
    int n,i,s=0; 
    scanf("%d",&n);
    int h[100000]={0};
    int *c = malloc(sizeof(int) * n);
    for(int c_i = 0; c_i < n; c_i++){
       scanf("%d",&c[c_i]);
        h[c[c_i]]++;
    }
    for(i=0;i<n;i++)
        {
        if(h[c[i]]!=0)
            {
            s=s+(h[c[i]]/2);
            h[c[i]]=0;
        }
    }
    printf("%d",s);
    return 0;
}
8.QUESTION
The Utopian Tree goes through 2 cycles of growth every year. Each spring, it doubles in height. Each summer, its height increases by 1 meter.
Laura plants a Utopian Tree sapling with a height of 1 meter at the onset of spring. How tall will her tree be after  growth cycles?
SOLUTION
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

int main() {
    int n,i,b=1,j;
    scanf("%d",&n);
    int a[n];
    for(i=0;i<n;i++)
        {
        scanf("%d",&a[i]);
    }
    for(j=0;j<n;j++)
        {
    for(i=1;i<=a[j];i++)
        {
        if(i%2==1)
            {
            b=b*2;
        }
else
    {
    b=b+1;
}
    }
    printf("%d\n",b);
        b=1;
    }    
    return 0;
}
9.QUESTION
A Discrete Mathematics professor has a class of  students. Frustrated with their lack of discipline, he decides to cancel class if fewer than  students are present when class starts.
Given the arrival time of each student, determine if the class is canceled.
SOLUTION
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

int main() {
int t,i,j,count=0,n,m;
    scanf("%d",&t);
    for(i=0;i<t;i++)
        {
        scanf("%d%d",&n,&m);
        int a[n];
        for(j=0;j<n;j++)
            {
            scanf("%d",&a[j]);
            if(a[j]<=0)
                {
                count++;
            }
        }
                if(count>=m)
                printf("NO\n");
            
            else
                {
                printf("YES\n");
            }
        count=0;
    }
    return 0;
}
10.QUESTION
Lily likes to play games with integers and their reversals. For some integer , we define  to be the reversal of all digits in . For example, , and .
Logan wants to go to the movies with Lily on some day  satisfying , but he knows she only goes to the movies on days she considers to be beautiful. Lily considers a day to be beautiful if the absolute value of the difference between  and  is evenly divisible by .
Given , and , count and print the number of beautiful days when Logan and Lily can go to the movies.
SOLUTION
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main() {
    int a,b,n,y;
    scanf("%d%d%d",&a,&b,&n);
    int i,t,x,s=0,c=0;
    for(i=a;i<=b;i++)
        {
        t=i;
        s=0;
        while(t!=0)
            {
            x=t%10;
            s=(s*10)+x;
            t=t/10;
        }
        y=abs(s-i);
        if(y%n==0)
            {
            c++;   
        }
    }
    printf("%d",c);        
    return 0;
}