Tuesday, 12 December 2017

HIDDEN FACTS - 00

             We start hidden facts series. In this series we discuss about hidden facts in this world.

what contents are in this series?
             In this series we discuss about entertainment, music, art,fashion, costumes, suggestions, stories, places, destroyed things, destroyable things, gadget, natural,food, tech news, cultures, leaders,human beings,automobiles ,animals, etc,. So, if you feel miss something means comment.Give your support.The respective articles are coming soon.......

Sunday, 10 December 2017

Pattern printing using asterix in shape of Q

     
   Pattern printing is to arrange the symbols.

In this program,I arranged the asterix symbol in the shape of Q.
Like the below,
            
                  ********
                  *             *
                  *             *
                  *             *
                  *         *  *
                  *           **
                  ********          
                                  *

 Program:

#include<iostream>
using namespace std;
int main()
{
    int i;
    for(i=0;i<=7;i++)
    {
        switch(i)
        {
            case 1:cout<<"******"<<endl;           break;
            case 2:cout<<"*       *"<<endl;break;
            case 3:cout<<"*       *"<<endl;break;
            case 4:cout<<"*    * *"<<endl;break;
            case 5:cout<<"*     **"<<endl;break;
            case 6:cout<<"******"<<endl;break;
            case 7:cout<<"           *"<<endl;break;
        }
    }
}

Sample outlet:


Alternate sorting


   Alternate sorting is a problem of testing the knowledge of using loops and conditional statements. 

Problem:

           Given an array of integers,rearrange the array in such a way that first element is 
first maximum and the second element is 
first minimum.
   Eg:
        Input:  1,2,3,4,5,6,7
        Output: 7,1,6,2,5,3,4

Program:


#include<iostream>
using namespace std;
int main()
{
    int arr[50],n,i,j;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>arr[i];
    }
    for(i=0;i<n-1;i++)
    {
        for(j=i;j<n;j++)
        {
            if(i%2==0)
            {
               if(arr[i]<arr[j])
                {
                    int temp=arr[i];
                    arr[i]=arr[j];
                    arr[j]=temp;
                }
            }
            else
            {
                if(arr[i]>arr[j])
                {
                     int temp=arr[i];
                      arr[i]=arr[j];
                      arr[j]=temp;
                }
            }
        }
    }
    for(i=0;i<n;i++)
    {
        cout<<arr[i]<<endl;
    }
}

Output:


Saturday, 9 December 2017

Array sorting based weight of elements

Problem:  Given a set of numbers like <10, 36, 54,89,12> we want to find sum of weights based on the following conditions

    1. 5 if a perfect square

    2. 4 if multiple of 4 and divisible by 6

    3. 3 if even number

And sort the numbers based on the weight and print it as follows

<10,its_weight>,<36,its weight><89,its weight>

Should display the numbers based on increasing order.

Program:

#include<iostream>
#include<math.h>
using namespace std;
bool even(int x);
bool divisible(int x);
bool perfectsqr(int x);
int main()
{
    int arr[5]={10,36,54,89,12};
    int sum[5],i,temp;
    for(i=0;i<5;i++)
    {
         sum[i]=0;
         if(perfectsqr(arr[i]))
                sum[i]=sum[i]+5;
         if(divisible(arr[i]))
                sum[i]=sum[i]+4;
         if(even(arr[i]))
                sum[i]=sum[i]+3;
       
    }
    for(i=0;i<4;i++)
    {
        for(int j=i;j<5;j++)
        {
            if(sum[i]<sum[j])
            {
                 temp=sum[i];
                 sum[i]=sum[j];
                 sum[j]=temp;
                 temp=arr[i];
                 arr[i]=arr[j];
                 arr[j]=temp;
            }
        }
    }
    for(i=0;i<5;i++)
    {
        cout<<"<"<<arr[i]<<","<<sum[i]<<">";
        if(i!=4)
        cout<<",";
    }
    return 0;
}
bool even(int x)
{
    if(x%2==0)
        return 1;
    else
        return 0;
}
bool divisible(int x)
{
    if(x%4==0 && x%6==0)
        return 1;
    else
        return 0;
}
bool perfectsqr(int x)
{
   int ires;
    float fres=sqrt(x);
    ires=fres;
    if(ires==fres)
        return 1;
    else
        return 0;
}
Sample output:



Friday, 8 December 2017

Pattern printing (in a single loop)


Problem:


               Print the following pattern.

                              P          m
                                r      a
                                  o  r
                                    g 
                                  o  r
                                r      a
                              P          m

Criteria:

        One single for loop should be used (or) thecomplexity of the program should be O(n).



#include<iostream>
using namespace std;
int main()
{
    char str[20]="Program";
    int i;
    for(i=0;i<10;i++)
    {
        char out[20]="          "; 
        out[i]=str[i];
        out[6-i]=str[6-i];
        cout<<out;
        cout<<"\n";
    }
    return 0;

}    

SaSample output:

mple output:


   




Monday, 4 December 2017

Finding immediate greater


In this post,I demonstrate a problem which is asked in zoho interviews.

So, i think tis will be usefull for the people who are preparing for their
job interviews.

Question:

Find immediate greater in an array

An array of 'n' elements is given,
immediate greater element for every element should be found in the array.

Input:
6 4 3 9 5

Output:
6->9 4->5 3->4 9-> 5->6


Algorithm:

1.Get the elements in an array.
2.Sort the elemens in the separate another array.
3.Take an element in unsorted array and find its position in
   sorted array and its next element is its immediate greater.
4.Do the same process for all elements.
5.If its positiion in sorted array is n-1,then it do not have
  any greater element to it.

Program:

#include<stdio.h>

#include<conio.h>
int arr[50],sort[50],n;
int search(int a);
void sorting();
void main()
{
int i,j;
clrscr();
printf("Enter no. of elements in the array\n");
scanf("%d",&n);
printf("Enter array elements\n");
for(i=0;i<n;i++)
      {
scanf("%d",&arr[i]);
sort[i]=arr[i];
       }
sorting();
for(i=0;i<n;i++)
{
j=search(arr[i]);
if(j+1==n){printf("%d->\t",arr[i]);}
else
printf("%d->%d\t",arr[i],sort[j+1]);
}
getch();
}
void sorting()
{
int i,j,temp;
for(i=0;i<n-1;i++)
{
for(j=i+1;j<n;j++)
{
if(sort[i]>sort[j])
    { temp=sort[i];
sort[i]=sort[j];
sort[j]=temp;
    }
}
}
return;
}
int search(int a)
{
int i;
for(i=0;i<n;i++)
{
if(a==sort[i])
return i;
}
}


Hope you understand the problem and the solution for it.
Any questions or complexity in explanation ask in comments.
                           Thank you.

Friday, 1 December 2017

Binary to decimal conversion using recursion


// CONVERSION OF BINARY TO DECIMAL USING RECURSION


/*PROCEDURE
   1.Eg:  Take a binary number as 1110
   2.1   1   1 0
       |    |    |    |->multiplyby2^0=result0
               |    |    |->multiply by 2^1  =result1
               |    |->multiply by 2^2  =result2
               |->multiply by 2^3  =result 3

  3.Final ,the converted decimal number=result0+result1+result2+result3

*/


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


int todecimal(char bin[50],int len);
int len; //Using ‘len’ as global variable is optional

void main()
{
char bin[50];
int dec;
clrscr();
printf("Enter the binary number\n");
scanf("%s",bin);
len=strlen(bin);
dec=todecimal(bin,len);
printf("%d",dec);
getch();
}
int todecimal(char bin[50],int l)
{
      if(len-l==len)
return 0;
      else
      {
   if(bin[len-l]=='0')
return todecimal(bin,l-1);
   else
return 1*pow(2,l-1)+todecimal(bin,l-1);
      }
}

Any doubts ask it in comments.
Finally share this program,if you like this.
                             Thank you.

Tuesday, 28 November 2017

Display linklist in reverse order


     
// C program reversing the Linklist (or)
Display the Linklist in reverse order

//Procedure
    //1.Use two pointer to print the last element and delete the last element
    //2.Repeat it for 'n' times,
    // where n=length of the list.
    //That is,every time last element is printed and is deleted from the list.
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>

//Declaration of structure of link list
struct node
{
int data;
struct node *next;
}ptr1;


void main()
{
int x,ch,n=0,i;
struct node *ptr2,*head,*ptr1;
clrscr();
printf("\t\tCreate the list\n");
printf("\t***************************\n");

// Creaion of Linklist
head=(struct node*)malloc(sizeof(struct node));
ptr1=head;
do
{
printf("Enter the data part of the node\n ");
scanf("%d",&ptr1->data);
ptr1->next=(struct node*)malloc(sizeof(struct node));
ptr1=ptr1->next;

printf("do you want to continue(1/0)\n");
scanf("%d",&ch);
n++;
}while(ch);

// Here,'n' records the length of the list
i=0;

//display ilst in reverse order
while(i<n)
{
ptr1=head;
while(ptr1->next != NULL)
{
ptr2=ptr1;
ptr1=ptr1->next;
}
printf("%d\n",ptr2->data); //Printing the last element


ptr2->next=NULL; //Deleting the last element

i++;

}
getch();
}

Hey,guys hope you understand this program.

Any queries,suggestions and alternative way solutions are welcomed.

If you want programs for some other questions ,please comment them below.

Tuesday, 24 October 2017

LYRICS OF LOOK WHAT YOU MADE ME DO

The lyrics of Look what you made me do song. Sing by Taylor swift. It's a nice song.
It's like a bold song,but it is not attract very much.

    LOOK WHAT YOU MADE ME DO
                                     by Taylor swift
I don't like your little games
don't like your tilted stage
The role you made me play
of the fool
No I don't like you
I don't like your perfect crime
How you laugh when you lie
you said the gun was mine
isn't cool
No I don't like you... ooh
But I got smarter I got harder
In the nick of time,
Honey I rose up from the dead
I do it all the time
 I got a list of names
And yours is in red, underlined
I check it once then I check it twice... ooh
ooh.. Look what you made me do
Look what you made me do
Look what you just made me do
Look what you just made me do
Look what you made me do
Look what you made me do
Look what you just made me do
Look what you just made me do
I don't like your kingdom keys
They once belonged to me
you asked me for a place to sleep
Locked me out
And threw a feast
The world moves on another day
another drama drama
But not for me not for me
All I think about is karma
And then the world moves on
But one things for sure
May be I got mine
But you'll all get yours
But I got smarter I got harder
In the nick of time,
Honey I rose up from the dead
I do it all the time
 I got a list of names
And types is in red, underlined
I check it once then I check it twice... ooh
ooh.. Look what you made me do
Look what you made me do
Look what you just made me do
Look what you just made me do
ooh.. Look what you made me do
Look what you made me do
Look what you just made me do
Look what you just made me do
I don't trust nobody and nobody trust me
Till be the actress starting on your bad dreams
I don't trust nobody and nobody trust me
Till be the actress starring on your bad dreams
I don't trust nobody and nobody trust me
Till be the actress starring on your bad dreams
I don't trust nobody and nobody trust me
Till be the actress starring on your bad dreams..
I'm sorry but the old Taylor can't come to the phone right now
why? ooh.. cause she's dead
ooh.. Look what you made me do
Look what you made me do
Look what you just made me do
Look what you just made me do
ooh.. Look what you made me do
Look what you made me do
Look what you just made me do
Look what you just made me do
ooh.. Look what you made me do
Look what you made me do
Look what you just made me do
Look what you just made me do
ooh.. Look what you made me do
Look what you made me do
Look what you just made me do
Look what you just made me do


In the above content is not satisfy, please comment on my comment box. If it useful share your friends
Share your smile!!!! spread your love!!!!

Saturday, 5 August 2017

Lose to wizarding world

LOST OF WIZARDING WORLD . .

Aug 3,2017...Minister of Magic  Cornelius Fudge is died at 91. His real name is Robert Hardy. His part of Harry Potter series is very big . He is doing great things in Wizarding world. At his age, Ministry of Magic make  brightest world.  He's also encouraging Harry to do great things. According to Harry Potter series, all characters are help. In that thing, Fudge doing many helps . we have lost one person in Wizarding world .He is a great actor.  So , we have to pray for his soul. 

J. K. ROWLING'S TWEET :

So very sad hear about Robert Hardy. He was  such a talented actor and everybody who worked with him on potter loved him . 

So,above content is not satisfying . please comment on my comment box . Thank u. . . . 

Tuesday, 20 June 2017

We changed the title

           
   Hello guys , how the life journey travels? and I belive that it will be smoothfull and I am here now to inform you one update from myself πŸ“œand it was tontodain

the name of our blog was changed from                 '     πŸ”ˆ'Listenbig to the angry        youngman'πŸ“œ.'

      Do you like this change πŸ‘?
If yes , then then please notify me or not then notify me with some suggestions.
                       Thank you every one.

Monday, 12 June 2017

Smart phones


Today's world is smart world. we all are got smart phones. That's why we are all survive in this world. Now all kind of people are using the smart phones very much. We have to keep the smart phones in very good state. Then only it gives good performance in its work.
So, what are those things not to done in Android phones.
1.Don't use any cleaner app, because it will decrease the mobile performance.
2.May be use one Antivirus app , now some anti virus app not to do only antivirus part only It'll do apart from that. It'll take battery and performance.
3.Don't clean cache memory often, if you clean cache memory, each and everytime it will start newly. Always keep in recent app.
4.Don't use fake apps, because it is waste of storage.
5.Now many people do this thing usually, i.e., reboot, don't do reboot, only do shutdown that is enough. Weekly once or 2 days once.
6.App permissions we are all whatever asking in that terms and conditions only give accept. Whatever you want accept that only, after read.
7.App from unknown source, don't download unofficial app. Please use play store apps that had enough apps.
8.Don't Use Battery saver, because it just only do reduce the brightness and stop the background apps. Manually do these things.
9.Avoid  Spam messages.
10.Don't do rooting. If you know rebooting for your respective device, you'll do. Otherwise don't do, it will make/create many troubles.
In the above content, contain any mistakes or wrong please comment on my comment box.
Thanks!!

Sunday, 21 May 2017

Manooohhhariii- secret behind the success of Bahubali

                      Jai Mahismathi...,

   hey hi,can you please tell me why kattapa killed bahubali?,.ok ok i am hearing your mindvoice.Obiously it was revealed in the movie,It was released on this month and make unbreakable records in collection are known things.But the question is how they made it possible (1.5k crores in a single movie)(it will be greater than whole indian film industries one year collections),how they achieve this and what's the secret behind making the 'Bahubali' as a brand?.Already many peoples talk about this,but now i am trying  to present this in different perspective.
                     Jai Mahismathi...,



First, Story making

         They made the story based on some basic human psychologies,(i think ss rajamouli should be strong in  audience psychology and his father vijayendraprasad was awesome in creating those stuffs)
All films of their combo tells me this like 'vikramarkadu,chatrapathy,mahadheera,eega'.Above all the reflections of the great epics of india (mahabharatha and ramayana) are widely comprised in this film.
         That is they perfectly catch the pulse of audience.

Second,Detailing in characterisation

           A strong story demands strong characters ,yes this is true in bahubali's scenario.The characters are revealed in the bahubali part 1- the scenes of lifting siva lingam and climbing mountain rocks for mahendra bahubali ,killing a bull for ballal deva and so on for kattapa,sivagami devi,amerandra bahubali,devasena,bijjlaldeva.
 They very detaily create and present those characters by making variations in costumes ,even in symbols drawn on their foreheads.

Third, Casting

          Casting perfectly suits and enhancing the characters in acting and appearance.Casting and the actors way expressing their roles play very important role behind its success.

Forth,Visualization

         Eventhough the story is immense,making visuals for that was not a simple task. The behind screen team of bahubali works great on creating those massive stuffs on the screen.Visuals in part 1 creates expectations for part 2.May be if story bahubali failed,the visuals of overcome this failure on story side.

Fifth, Music

         Yes 'music is the soul of bahubali',background music with visuals in many scenes creates goosebumps and MM Keeravani would blend his mind with Rajamouli for creating these master work .Obiously music is the one of main reasons for repeated audience.More importantly the wonderfull experience of bahubali would not be fulfilled without music.
              Among all of this a huge of effort of six years and great work of thousands of workers made the film marvellous.
          If you love this share it with your friends and mention if I missed anything in comment box and give suggestions on my work.
                  Jai Mahismathi....