Friday, 17 May 2019

Write a program to sort the elements in odd positions in descending order and elements in

ascending order


Eg 1: Input: 13,2 4,15,12,10,5

        Output: 13,2,12,10,5,15,4

Eg 2: Input: 1,2,3,4,5,6,7,8,9

        Output: 9,2,7,4,5,6,3,8,1 


CODE

#include<conio.h>
#include<string.h>
void main()
{
int i,n,t,a[100];

scanf("%d",&n);

for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}


for(i=0;i<n;i+=2)
{
if(i%2==0)
{
if((a[i]<a[i+2])&&((i+2)<n))
{
t=a[i];
a[i]=a[i+2];

a[i+2]=t;
}
}
else
{
if((a[i]>a[i+2])&&((i+2)<n))
{
t=a[i];
a[i]=a[i+2];
a[i+2]=t;
}
}
}
for(i=0;i<n;i++)
{
printf("\t%d",a[i]);
}


}



 Find if a String2 is substring of String1. If it is, return the index of the first occurrence. else return -1.
Eg 1:Input:
        String 1: test123string
         String 2: 123
        Output: 4
Eg 2: Input:
        String 1: testing12
        String 2: 1234 
        Output: -1

#include<conio.h>
#include<string.h>
void main()
{
int i,j=0,r=0,m,n;
char a[100],b[100];
scanf("%d,%d",&n,&m);

gets(a);
gets(b);

n=strlen(a);
m=strlen(b);


for(i=0;i<n;i++)
{
if(a[i]==b[j])
{
r=i;
i++;
for(j=1;j<m;j++)
{
if(a[i]==b[j])
{
i++;
}
else
{
r=-1;
j=m;
}
}
}
else
{
if(r==0)
{
r=-1;
}
}

j=0;

}
printf("%d",r);


}

Monday, 12 January 2015

  •  HOW TO CREATE A CORRUPTION LESS INDIA???,,...
  1. DO YOUR WORK SINCERELY.
  2. DON'T INTERFERE IN OTHER'S WORK. 
  3. LEAVE OTHERS TO DO THERE WORK
  4. BE HONEST FOR YOUR SOUL.
  5. DON'T GIVE  IMPORTANCE TO MONEY. GIVE MORE TO HUMANS.
  6. BEING YOU IS MOST IMPORTANT THING TO CREATE A CORRUPTION LESS INDIA . 

Top 12 Toughest Exams in the World  [ MOST OF THE EXAMS ARE HELD IN INDIA BECAUSE INDIAN STUDENTS ARE MOST BRILLIANT IN THE WORLD] 



  1.  Master Sommelier Diploma Exam {FOR ALL OVER WORLD}

1

2. All Souls Prize Fellowship Exam{all over the world}

2

3. CFA (Chartered Financial Analyst) Exam{all over the world}


3

4. GRE (Graduate Record Examinations){for states}


4

5. Mensa{all over the world}


5

6. UPSC (Union Public Service Commission){for India}


11

7. IIT JEE (Indian Institute of Technology Joint Entrance Examination){for India}


6 

8. Gaokao{ for China}

7

9. GATE (Graduate Aptitude Test in Engineering){for India}


8

10. CCIE (Cisco Certified Internetworking Expert){for all over the world}


9

11. LNAT (National Admission Test for Law){for UK}


10

12. IES (Indian Engineering Services){for India}


12








                       He said the real truth what is happening in our world..

   "TODAY STUDENTS, YOUTH ARE TOMORROW'S INDIA"
         


PROUD TO BE INDIAN....

 INDIAN STUDENTS ARE GREATEST BACK BONE OF THE WORLD...

 BE HONEST OF OUR NATION..

IF CORRUPTION IS DELETED  OUR NATION WILL BE THE FIRST AND GREAT NATION IN THE WORLD....

Saturday, 19 July 2014

THE HANGING BRIDGE

Mathur Aqueduct or Mathur Hanging Trough in Tamil Thotti palam is in Mathur, Kanyakumari District of Tamil Nadu
Its is the  Tallest and longest bridge in  Asia. its constucted in 1996 by late Mr.Kamaraj.

 It is constructed across the river Parazhiyar and the trough Pattanamkal canal on the bridge carries water for irrigation from one side of a hill to the other side of a hill.


The trough has a height of 7 feet with a width of 7 feet 6 inches. The canal is being shouldered by 28 huge pillars




.  These all done by the  efforts of late Mr. K. Kamaraj, the former Chief Minister of Tamil Nadu.




U CAN TOUCH THE SKY, IF U WORK HARD 

Friday, 18 July 2014

GOOGLE.....

GOOGLE
    Today's information is about "GOOGLE DOODLE'.
                            GOOGLE make as proud by its DOODLE. we all know that GOOGLE home page is different day by day.
Marie Curie's 144th Birthday
 In world there are many scientists are there.  There is a something special for SCIENTISTS   MARIE SKLODOWSKA-CURIE AND SIR CHANDRASEKHARA RAMAN
SIGoogle Doodle for Sir C. V. Raman on his birthday on November 7.
                                Only for these two scientists GOOGLE provided there pic as GOOGLE DOODLE.
                                      WOW..... WHAT A GREAT PEOPLES THEY ARE. These all because of there  ""HARD WORK".
                           
                                              TRY TRY TRY...... UNTIL YOU SUCCEED. 
                                                                             ALL THE BEST!!!!