SHARE
TWEET

Untitled

a guest Sep 11th, 2014 661 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. int main()
  3. {
  4.         int i,max=0,temp=0;
  5.         int a[] = {23,43,53,12,66,23,55,99,23,67,3};
  6.         for(i=0;i<=10;i++)
  7.         {
  8.                 if(a[i]>max)
  9.                 {
  10.                         temp = max;
  11.                         max = a[i];
  12.                 }
  13.                 else
  14.                 {
  15.                         if(temp < a[i])
  16.                                 temp = a[i];
  17.                 }
  18.         }
  19.         printf("Second largest element is %d",temp);
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top