Sunday, 26 July 2015

break-statement

When break is encountered inside any loop, control automatically passes to the first statement after the loop.
 A break statement is usually associated with an if.

Example program

//program to print first 6 numbers only
#include<stdio.h>
#include<conio.h>
int main()
{
int i;
for(i=0;i<=10;i++)
{

printf("%d\n",i);
if(i==6)
break;

}
getch();
return 0;

}

output:
0
1
2
3
4
5
6

Though we wrote the program to print 10 numbers, the numbers after 6 are not printed because of the break statement. Here the moment the system encounters the break statement, control automatically passes to the next statement after the loop.

//program to determine whether a number is prime or not
#include<stdio.h>
#include<conio.h>
int main()
{
int num, i;
printf("enter a number\n");
scanf("%d",&num);
i=2;
while(i<=num-1)
{
if(num%i==0)
{
printf("not a prime number");
break;
}
i++;
}
if(i==num)
printf("prime number");
getch();
return 0;
}

output:
enter a number
9
not a prime number

continue statement

If I want to print numbers from 1 to 10 with the exception of 2 how???

continue :When continue is encountered inside any loop, control automatically passes to the beginning of the loop.
A continue is usually associated with an if.

Example
#include<stdio.h>
#include<conio.h>
int main()
{
int i;
for(i=0;i<=10;i++)
{
if(i==2)
continue;
printf("%d\n",i);
}
getch();
return 0;
}

output:
0
1
3
4
5
6
7
8
9
10


//program to print odd numbers

#include<stdio.h>
#include<conio.h>
int main()
{
int i;
for(i=0;i<=10;i++)
{
if(i==2)
continue;
printf("%d\n",i);
}
getch();
return 0;

}

output:
1
3
5
7
9







Tech 2


do-while

Confused with while and do-while?

simple thing- while executes the set of instructions in the loop only if the condition specified is true. On the other hand, do- while executes the set of instructions atleast once what ever the condition may be.

syntax:

while                                                                    do-while

while(i<=10)                                                       do
{                                                                          {
 printf("%d",i);                                                          this;
                                                                                and this;
                                                                           }while(this condition is true);
i++;
}


1.Example program
#include<stdio.h>
#include<conio.h>
int main()
{
while(4<2)
printf("this is while");
return 0;
}


output:
No output will be generated as the condition fails.


#include<stdio.h>
#include<conio.h>
int main()
{
do
   {
      printf("this is do- while");
    }while(5<2);
return 0;
}


output:
this is do-while
since it is do-while the printf statement will be executed atleast once.


Friday, 24 July 2015

Loops-for

for is the most popular looping instruction.The for allows us to specify three things about a loop in a single line:

1.Setting a loop counter to an initial value
2.Testing the loop counter to determine whether its value has reached the number of repetitions desired
3.Increasing the value of loop counter each time the program segment within the loop has been executed.

syntax for for- loop

for(initialization; test counter; increment counter)
{
do this;
do this;
}


//program to print N numbers

#include<stdio.h>
#include<conio.h>
int main()
{
int i,n;
printf("Till which number do you want to print");
scanf("%d",&n);
for(i=0;i<=n;i++)
{
printf("%d\n",i);
}
  getch();
  return 0;
}

output:
Till which number do you want to print 4
0
1
2
3
4


//Calculation of simple interest for 3 sets of p, n, r
























Formats:

 for(i=10;         i;                    i--)
printf("%d",i);

for(i<4;                   j=5;            j=0)
printf("%d",i);


for(i=1;              i<=10 ;             printf("%d",i++))
;


Loops- while

The programs that we have discussed so far used either a sequential or a decision control instruction. In the first one, the calculations were carried out in a fixed order; while in the second one, an appropriate set of instructions were executed depending on the outcome of the condition being tested.

             These programs have a limited scope, because when executed they always perform the same series of actions, in the same way exactly once. But in real life if something is worth doing, it has to be done more than once.

Loops:
           The versatility of the computer lies in its ability to perform a set of instructions repeatedly. This involves repeating some portion of the program either a specified number of times or until a particular condition is being satisfied.This repetitive operation is done through a loop control instruction.


Syntax of while loop:

while(condition)
{


set of statements;
increment statement;


}

//simple programs using while loop

//calculation of simple interest for 3 sets of p, n and r
#include<stdio.h>
#include<conio.h>
int main()
{
int p, n, count;
float r, si;
count=1;
while(count<=3)
{
  printf("enter values of p, n and r\n");
scanf("%d%d%f",&p,&n,&r);
si=p*n*r/100;
printf("simple interest =rs %f\n",si);
count=count+1;
}
return 0;
}

output: 
enter values of p, n and r
1000 5 13.5
simple interest =rs 675.000000
enter values of p, n and r
2000 5 13.5
simple interest =rs 1350.000000
enter values of p, n and r
3500 5 3.5
simple interest =rs 612.500000


//To print numbers

#include<stdio.h>
#include<conio.h>
int main()
{
int i=0,n;
printf("how many numbers do you want to print\n");
scanf("%d",&n);
while(i<=n)
  {    
printf("%d\n",i);
i++;
  }
  getch();
return 0;
}

output:
how many numbers do you want to print
5
0
1
2
3
4
5


//To print even numbers
#include<stdio.h>
#include<conio.h>
int main()
{
int i=1,n;
printf("enter the number\n");
scanf("%d",&n);
printf("0\n");
while(i<=n)
{
if(i%2==0)
printf("%d\n",i);
i++;
}
  getch();
  return 0;
}

output:
enter the number
12
0
2
4
6
8
10
12








Saturday, 18 July 2015

Analogies- Animal/Bird/ and sound



There are different words in English to describe the sounds made by different animals and birds.
One type of Analogy questions tests your knowledge of these words

EX: lion:roar::cat:mew
A lion roars;a cat mews

donkey:bray::horse:neigh
A donkey brays;a horse neighs 



ape gibber hog grunt
bee hum lamb bleat
camel grunt mouse squeak
cow moo, low raven croak
dove coo thrush whistle
elephant trumpet bear growl
frog croak bull bellow
hen cluck cock crow
jackal howl donkey bray
lion roar eagle scream
pig grunt fox yelp
squirrel chirp goose cackle
ass bray horse neigh
bird twitter, chirp lark sing
cat mew owl hoot
dog bark serpent hiss
duck quack turkey gobble
fly buzz goat bleat

Analogies-Habitat

English language has specific words for places where particular animals, birds, insects, plants or trees either naturally or are grown by us.

EX: dog:kennel::pig:sty
dogs are grown in a kennel;pigs are grown in a sty


bat cave owl barn
convict prison rabbit burrow, hutch, warren
dove cote soldier barrack
fish aquarium tree arboretum
horse stable, corral bird nest
lunatic asylum delinquent reformatory
nun convent eskimo igloo
pig sty gondola canal
sheep fold, pen lion den
student dormitory mouse hole
bee hive, apiary pea pod
cow byre spider web
eagle, hawk aerie wolf lair
fowl coop monk abbey, monastery
Indian tepee, teepee

Analogies-Young and the Grown up

English language has different single words for referring to the same animal when it is young and when it has grown up.

EX: cub:tiger::calf:cow
A cub is a young tiger; a calf is a young cow

       chicken:hen::cygnet:swan
A chicken is a young hen; a cygnet is a young swan


acorn oak lamb sheep
child man poult turkey
cygnet swan sapling tree
fingerling fish tadpole frog
gosling goose caterpillar butterfly
kitten cat cub tiger, lion, bear
plant tree fawn deer
pup dog, seal foal horse
squab pigeon joey kangaroo
calf cow piglet pig
colt filly pullet chicken
duckling duck shoat pig
fledgling bird whelp dog
heifer cow owllet owl

Analogies- Person and Tool

If you know these categories, we can easily identify the relation between the given pair of words.


EX 1: Carpenter:saw::Writer:Pen

A carpenter uses a saw; A writer uses a pen


EX 2: cowboy:lasso::auctioneer:gavel
       

angler                      tackle archer arrow, bow, quiver
artist brush auctioneer gavel
baker owen biologist microscope
blacksmith, farrier anvil boatman oar
boxer, pugilist glove carpenter chisel, saw, drill, sand paper
cobbler last cowboy lariat, lasso
diver flippers farmer plow, scythe, sickle, hoe
fisherman net, seine gardener rake
golfer club, spikes mason trowel, shovel
painter brush referee whistle
plumber wrench physician sethoscope
sculptor chisel sailor sextant
seamstress needle spinner spindle
surgeon forceps,  lancet, scalpel trapper snare
weaver loom woodsman axe

Material to crack verbal

Friday, 17 July 2015

Switch

The control statement that allows us to make a decision from the number of choices is called a switch statement.

Syntax:

switch(integer expression)
{
case constant 1:
            do this;
case constant 2:
            do this;
case constant 3:
              do this;
default:
         do this;
}


Examples:
1.//program

#include<stdio.h>
#include<conio.h>
int main()
{
int i=2;
switch(i)
{
case 1:
printf("in class 1");
break;
case 2:
printf("in class 2");
break;
case 3:
printf("in class 3");
break;
default:
printf("in default");

}
getch();
return 0;

}

output:
in class 2


2.//without break

#include<stdio.h>
#include<conio.h>
int main()
{
int i=2;
switch(i)
{
case 1:
printf("in class 1\n");

case 2:
printf("in class 2\n");

case 3:
printf("in class 3\n");

default:
printf("in default\n");

}
getch();

return 0;
}


output:
in class 2
in class 3
in default

//It executes the 2 case and all the remaining cases after the 2 case as the break statement is not present.

//We can write the cases in any order, not necessarily in ascending or descending order.


3.//cases arranged in random order
#include<stdio.h>
#include<conio.h>
int main()
{
int i=2;
switch(i)
{
case 1:
printf("in class 1\n");

case 3:
printf("in class 3\n");

   case 2:
printf("in class 2\n");

default:
printf("in default\n");

}
getch();
return 0;

}

output:
in class 2
in default



4.//Arithmetic operations -break statement is not present


#include<stdio.h>
#include<conio.h>
int main()
{
int a,b,x;
printf("enter two values\n");
scanf("%d%d",&a,&b);
printf("select operation +=1 or -=2 or /=3 or *=4 or %=5\n");
scanf("%d",&x);
switch(x)
{
case 1:
printf("sum of two numbers is %d\n",a+b);
case 2:
printf("difference of two numbers is %d\n",a-b);
case 4:
printf("product of two numbers is %d\n",a*b);
case 3:
printf("division of two numbers is %d\n",a/b);
case 5:
printf("modular division results %d\n",a%b);
default:
printf("enter any one of the operations");
}
getch();
return 0;
}

output:

enter two values
10
2
+=1 or -=2 or /=3 or *=4 or %=5
1
sum of two numbers is 12
difference of two numbers is 8
product of two numbers is 20
division of two numbers is  5
modular division results 0
enter any one of the operations


5.//To print month

#include<stdio.h>
#include<conio.h>
int main()
{
int month;
printf("enter month\n");
scanf("%d",&month);
switch(month)
{
case 1:
printf("january");
break;
case 2:
printf("February");
break;
case 3:
printf("March");
break;
case 4:
printf("April");
break;
case 5:
printf("May");
break;
case 6:
printf("June");
break;
case 7:
printf("July");
break;
case 8:
printf("August");
break;
case 9:
printf("September");
break;
case 10:
printf("October");
break;
case 11:
printf("November");
break;
case 12:
printf("December");
break;
}
getch();
return 0;
}

output:
enter month
5
May






Aptitude-profit and loss


This chapter deals with buying and selling of goods and the profit or loss involved in the transactions.

Cost price(cp): cost refers to the price at which an article is bought.

selling price(sp): selling price refers to the price at which an article is sold.

profit:
       If an article is sold at a price greater than the price for which it was bought, the trader makes a profit.

         Profit=selling price-cost price

Loss:
   If an article is sold at a price less than the price for which it was bought, then the trader makes a loss.

      Loss=cost price- selling price

Marked price(mp):
           The price indicated on the product or the price marked on the product is called the marked price.

 Discount:
          Trader sometimes sells goods at a price lower than the price marked on the product. This is called discount.

 Discount=Marked price-selling price


Profit percentage=  selling price-cost price  *100
                                          cost price

Loss percentage= cost price- selling price *100
                                        cost price
                               










Example:
         
1. Cost price= 100
 I want to earn 50% profit on selling this product so,
 2.Selling price= 100+ 50%(100)  =  150
People ask for discount so, I have to give a discount to them in spite of getting my 50% profit i.e., 50 rs.
Suppose I offer them a discount of 20 % on mrp, what should be my mrp so that I can get my profit


Ans:  mrp- 20%(mrp)= 150
     
         marked price(mrp)  = 187.5 rs


Questions to solve:

1.Raj and Ajay buys rice bags worth 45000 each. If Raj sells his rice bag at a profit of 15% and Ajay sells his rice bags at a loss of 5%. What is the overall profit/loss percentage?

Ans: 5%


2. Raju buys a book for Rs.100 and sells it at Rs 120. What was his percentage of profit in the deal?
Ans: 20%


3.A merchant buys goods worth Rs 30000 and pays Rs 25000 for their transportation. He sells the goods and makes a profit of 10%. How much did he sell the goods for?

4.The marked price of a wrist watch is 2900.If a discount of 15% is given on the watch, what is the selling price of the watch?

5.Two packs of rice are marked at the same price. The first pack of rice is sold at 2% discount and the seller makes a profit of 4% in it.The second pack of rice is sold at 4% discount and the seller makes a profit of 2% in it. What is the ratio of C.P of both the rice packs?
Ans:      833
              832












Technology 1


Idioms and Phrases

Idioms and phrases


to make clean breast of to confess without of reserve
child's play a very easy thing
bird's eyeview to general view from above
to scale up to measure
to clear the air to remove tension
to chew the chud to think deeply
to keep one's temper to be in good mood
tipped off given advanced information
between the devil and the deep sea to be in dilemma
to cut the crackle to stop talking and start
out and out absolutely
the cold shoulder ignored me
passed himself off pretended to be
no axe to grind to act selflessly
hanging fire going on slowly
die in harness die while still working
to play foul to do something wrong
to give currency to to pay much attention to
big draw a huge attraction
a fool's paradise to live in illusions
the alpha and the omega the beginning and the end
lost heart became discouraged
to miss the boat to miss an opportunity
to have cold feet to be reluctant
let the grass grow under his feet loitered around
with might and main with full vigour
on the nod on credit
back stairs influence secret and unfair influence
to see red to find fault with
rainy days unlucky times
let on reveal
a good samaritan a genuinely helpful person
blue blood an aristocrat
at one's wit's end to be completely confused
to play with fool
black sheep an unworthy person
pillar to post one place to another
a snake in the grass an unrecognizable enemy
have a go make an attempt
to turn over a new leaf to change one's behaviour for the better
oily tongue flattery
lions share greater share of a thing
to bury the hatchet to make up a quarrel
at sea perplexed
in deep water in real trouble
to look blue to look sad
stem from originate
take it ill to be offended
in a delicate state hanging by a hair
to bell the cat to take lead in danger

Verb forms

Base form past tense past participle
be was/were been
begin began begun
break broke broken
bring brought brought
buy bought bought
build built built
choose chose chosen
come came come
cost cost cost
cut cut cut
creep crept crept
do did done
draw drew drawn
drive drove driven
eat ate eaten
feel felt felt
find found found
get got got
give gave given
go went gone
have had had
hear heard heard
hit hit hit
hold held held
keep kept kept
know knew known
leave left left
lead led led
let let let
lie lay lain
lose lost lost
make made made
mean meant meant
meet met met
pay paid paid
put put put
run ran run
say said said
see saw seen
sell sold sold
send sent sent
set set set
sleep slept slept
sit sat sat
speak spoke spoken
spend spent spent
stand stood stood
swear swore sworn
swim swam swum
swing swung swung
take  took taken
teach  taught taught
tell told told
think thought thought
understand understood understood
wear wore worn
win won won
write wrote written

Thursday, 16 July 2015

Dressing sense for an interview

Friends what ever you wear for an interview shows how dignified you are, your interests.
I hope this video will be helpful for you.




































C language- if-else statement

The if statement will execute a single statement, or a group of statements when the expression following if evaluates to be true.It does nothing when the expression evaluates to false.
     By using if-else statement we can execute one group of statements if the expression evaluates to be true and another group of statements if the expression evaluates to false.


syntax:

if(condition)
do this;
else
do this;


if(condition)
{
execute 1;
execute 2;
}
else
{
execute 3;
execute 4;
}




1.//program to check if the given number is even or odd
#include<stdio.h>
#include<conio.h>
int main()
{
int x;
printf("enter a number\n");
scanf("%d",&x);
if(x%2==0)
printf("the given number is even");
else
printf("the number is odd");
return 0;
getch();

}

output:
enter a number
20
the given number is even


2.//Is 3=3.0?
#include<stdio.h>
#include<conio.h>
int main()
{
int x=3;
float y=3.0;
if(x==y)
{
printf("x and y are equal\n");
printf("3 and 3.0 are equal\n");
}
else
{
printf("x and y are not equal");
}
return 0;
getch();
}

output:
x and y are equal
3 and 3.0 are equal


3.//find error
#include<stdio.h>
#include<conio.h>
int main()
{
int x=2;
if(x==2&&x!=0);
printf("hello\n");
else
printf("bye");
return 0;
getch();
}

output: error
'else' without a previous 'if'


4.//interesting

#include<conio.h>
int main()
{
int x,y,z;
printf("enter three numbers\n");
scanf("%d%d%d",&x,&y,&z);
if(x&&y&&z)  
printf("you entered all non zero numbers\n");
else
printf("you entered a zero");
return 0;
getch();
}

output:
enter three numbers
1
5
8
you entered all non zero numbers
//if(&&5&&8)  is equal to  if(1&&1&&1)







C language- if statement

C has three major decision making instructions-the if statement, the if-else statement, and the switch statement.

In sequential control structure various steps are executed sequentially, we don't have to do anything at all . That is by default, the instructions in a program are executed sequentially. However in reality, we rarely want the instructions to be executed sequentially. Many a times we want a set of instructions to be executed in one situation and a different set of instructions in the other case.


             Hence a decision control instruction can be implemented in C using
1. The if-statement
2.The if-else statement
3.The conditional operators


//Syntax of if-statement

if(condition is true)
execute this statement;


In the () we can write anything which finally results either 1 or 0
If the result is 1 the statement immediately followed by the if-statement is executed then the control shifts to the next statement.

1.//program to allow a user into a website

#include<stdio.h>
#include<conio.h>
int main()
{
int age;
printf("hello user please enter your age\n");
scanf("%d",&age);
if(age>18)
printf("you can see the content of this website");
printf("whether you are >18 or <18 this statement gets printed");
getch();
}


output:
hello user please enter your age
20
you can see the content of this website
whether you are >18 or <18 this statement gets printed


2.//program to print even numbers
#include<stdio.h>
#include<conio.h>
int main()
{
int i, n;
printf("enter the final number");
scanf("%d",&n);
for(i=0;i<=n;i++)
{
if(i%2==0)
printf("%d\n",i);
}
getch();
}

output:
enter the final number
10
0
2
4
6
8
10


3.//calculation of total amount
#include<stdio.h>
#include<conio.h>
int main()
{
int qty,dis=0;
float rate,tot;
printf("enter quantity and rate\n");
scanf("%d%f",&qty,&rate);
if(qty>1000)
dis=10;
tot=(qty*rate)-(qty*rate*dis/100);
printf("total expenses=rs %f\n",tot);
return 0;
getch();
}

output:
enter quantity and rate
1500
10
total expenses =rs 1350.0000


4.//logical condition
#include<stdio.h>
#include<conio.h>
int main()
{
int a=300,b,c;
if(a>=400)
b=300;
c=200;
printf("%d\n%d\n",b,c);
return 0;
getch();
}

output:
0
200


5.//logical statement
#include<stdio.h>
#include<conio.h>
int main()
{
int x=10,y=20;
if(x==y)
printf("%d\n%d\n",x,y);
return 0;
getch();

}

output:
no output as the condition did not satisfy

Interview Questions

Guys here are the most frequently asked questions in interviews to test your communication skills, confidence level and your passion to work in the organization.

1.Tell me about yourself
2.How do you compensate for your weakness?
3.How do you make decisions?
4.How do you take advantage of your strengths?
5.How will you identify problems and opportunities on the job?
6.How would your friends describe you?
7.How would your teachers describe you?
8.How would the person who likes you least describe you?
9.I see you had an internship, did you pursue a full time job with them?
10.If I were to ask your teachers, what are your greatest things what would they say?
11.If you could choose any company to work for, which one it could be?
12.If you were the CEO of this company, what are the top two things you would do?
13.If you won the lottery, would you still work?
14.Is it more important to be lucky or skillful?
15.Tell me a suggestion you had made, that was implemented?
16.Tell me about a time when you helped someone to take an initiative?
17.Tell me about the time when you planned and co-ordinate a project from start to finish
18.Tell me about a time when you are angry/upset
19.Tell me about the worst teacher you ever had
20.Under what circumstances do you think you can be dishonest
21.What are some of your leadership experiences?
22.What are the most important qualities of successful people?And how do you rate yourself in these areas?
23.What are your long term career goals?
24.What changes have you made in yourself so that you could work better with your friends/classmates?
25.What do you do to grow your skills and knowledge of the industry?
26.What do you expect from this job?
27.What gets you up in the morning?
28.What historical figure do you admire and why?
29.What is the one thing you would like to do better? What is your plan for accomplishing that?
30.What is the last book you read for fun?
31.What is the most courageous action or unpopular stand that you have ever taken?
32.What is the most important thing you are looking for in a company
33.What is your biggest weakness that really a weakness and not a secret strength?
34.What is your favorite website?
35.What qualities in your classmates bother you most?
36.What would you do if you find out the company you worked for is doing something illegal?
37.What would you do if you get behind on schedule with a project?
38.When did any of your classmates challenged you?
39.What would you look to accomplish in the company in the 3 months?
40.Whats your favorite food/movie/book/game? And how would you convince someone who hated it to try it?
41.Why did you get into ECE/CSE/MECH/IT/CIVIL  particularly?
42.Would you be rather liked or feared?
43.Are you a leader or a follower?
44.Are you willing to travel?
45.Describe a time when you were asked to do something you wern't do? How did you handle it?
46.Describe a time when your team did not agree
47.Describe a college or school instance where you messed up?
48.Describe how you would complete a typical task on this job?
49.Describe the boss who could get the very best work from you?
50.Discuss your educational background
51.Discuss your resume
52.Do you know anyone who works for us?
53.Does a company need 'B' players (or) is it better of having 'A' players on staff ? why?
54.Give an example of how you set goals and achieve them
55.Have you had to turn a friend with a bad attitude into one with a good attitude?
56.How did you learn/hear about this position?
57.How did you prepare for this interview?
58.Give an example of how you are able to motivate your friends at college
59.What are you strengths?
60.How do you rate me as an interviewer?

Monday, 13 July 2015

C language basics 4- search programmes

1.//linear search

#include <stdio.h>
#include<conio.h>

int main()
{
   int array[100], search, c, n;

   printf("Enter the number of elements in array\n");
   scanf("%d",&n);

   printf("Enter %d integer(s)\n", n);

   for (c = 0; c < n; c++)
      scanf("%d", &array[c]);

   printf("Enter the number to search\n");
   scanf("%d", &search);

   for (c = 0; c < n; c++)
   {
      if (array[c] == search)     /* if required element found */
      {
         printf("%d is present at location %d.\n", search, c);
         break;
      }
   }
   if (c == n)
      printf("%d is not present in array.\n", search);
      getch();

   return 0;

}



output:
Enter the number of elements in array
6
14
12
15
16
17
18
Enter the number to search
17
17 is present at location 4




2.//Binary search

#include <stdio.h>
#include<conio.h>

int main()
{
   int c, first, last, middle, n, search, array[100];

   printf("Enter number of elements\n");
   scanf("%d",&n);

   printf("Enter %d integers\n", n);

   for (c = 0; c < n; c++)
      scanf("%d",&array[c]);

   printf("Enter value to find\n");
   scanf("%d", &search);

   first = 0;
   last = n - 1;
   middle = (first+last)/2;

   while (first <= last) {
      if (array[middle] < search)
         first = middle + 1;  
      else if (array[middle] == search) {
         printf("%d found at location %d.\n", search, middle);
         break;
      }
      else
         last = middle - 1;

      middle = (first + last)/2;
   }
   if (first > last)
      printf("Not found! %d is not present in the list.\n", search);
      getch();

   return 0;  

}


output:
Enter number of elements
5
Enter 5 integers
12
18
19
24
56
Enter value to find
24
24 is found at location 3



3.//palindrome ex: 121   1221
#include <stdio.h>
#include<conio.h>

int main()
{
   int n, reverse = 0, temp;

   printf("Enter a number to check if it is a palindrome or not\n");
   scanf("%d",&n);

   temp = n;

   while( temp != 0 )
   {
      reverse = reverse * 10;
      reverse = reverse + temp%10;
      temp = temp/10;
   }

   if ( n == reverse )
      printf("%d is a palindrome number.\n", n);
   else
      printf("%d is not a palindrome number.\n", n);
      getch();

   return 0;

}
output:
Enter a number to check if it is a palindrome or not
121
121 is a palindrome number





4./* Fibonacci Series c language */
#include<stdio.h>
#include<conio.h>

int main()
{
   int n, first = 0, second = 1, next, c;

   printf("Enter the number of terms\n");
   scanf("%d",&n);

   printf("First %d terms of Fibonacci series are :-\n",n);

   for ( c = 0 ; c < n ; c++ )
   {
      if ( c <= 1 )
         next = c;
      else
      {
         next = first + second;
         first = second;
         second = next;
      }
      printf("%d\n",next);
   }
   getch();

   return 0;
}


output:
Enter the number of terms
10
0
1
1
2
3
5
8
13
21
34



5.
/* Bubble sort code */

#include <stdio.h>
#include<conio.h>

int main()
{
  int array[100], n, c, d, swap;

  printf("Enter number of elements\n");
  scanf("%d", &n);

  printf("Enter %d integers\n", n);

  for (c = 0; c < n; c++)
    scanf("%d", &array[c]);

  for (c = 0 ; c < ( n - 1 ); c++)
  {
    for (d = 0 ; d < n - c - 1; d++)
    {
      if (array[d] > array[d+1]) /* For decreasing order use < */
      {
        swap       = array[d];
        array[d]   = array[d+1];
        array[d+1] = swap;
      }
    }
  }

  printf("Sorted list in ascending order:\n");

  for ( c = 0 ; c < n ; c++ )
     printf("%d\n", array[c]);
 getch();
  return 0;

}

output:
Enter number of elements
5
Enter 5  integers
2
54
3
15
55
Sorted list in ascending order
2
3
15
54
55