Line 1: Line 1:
 +
 +
 +
 +
 +
 
<pre>
 
<pre>
  
Line 39: Line 44:
 
}
 
}
 
</pre>
 
</pre>
 +
 +
 +
 +
<syntaxhighlight lang="php">
 +
<?php
 +
    $v = "string";    // sample initialization
 +
?>
 +
html text
 +
<?
 +
    echo $v;        // end of php code
 +
?>
 +
</syntaxhighlight>

Revision as of 21:18, 15 November 2013




#include<stdio.h>
int main()
{
        int i,n,pi,ni, count = 0;
        int a[1000];
        printf("Enter size of array: ");
        scanf("%d",&n);
        printf("Enter numbers of array\n");
        for(i=0; i<n; i++)
        {
                scanf("%d",&a[i]);
        }
        ni =n-1;
        while(a[ni] >= 0)
                ni--;
        pi = 0;
        while(a[pi] <0)
                pi++;
        while(ni >pi)
        {
                int temp = a[pi];
                a[pi] = a[ni];
                a[ni] = temp;
                while(a[ni] >= 0)
                        ni--;
                while(a[pi] <0)
                        pi++;

        }

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


}


<syntaxhighlight lang="php"> <?php

   $v = "string";    // sample initialization

?> html text <?

   echo $v;         // end of php code

?> </syntaxhighlight>




#include<stdio.h>
int main()
{
        int i,n,pi,ni, count = 0;
        int a[1000];
        printf("Enter size of array: ");
        scanf("%d",&n);
        printf("Enter numbers of array\n");
        for(i=0; i<n; i++)
        {
                scanf("%d",&a[i]);
        }
        ni =n-1;
        while(a[ni] >= 0)
                ni--;
        pi = 0;
        while(a[pi] <0)
                pi++;
        while(ni >pi)
        {
                int temp = a[pi];
                a[pi] = a[ni];
                a[ni] = temp;
                while(a[ni] >= 0)
                        ni--;
                while(a[pi] <0)
                        pi++;

        }

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


}


<syntaxhighlight lang="php"> <?php

   $v = "string";    // sample initialization

?> html text <?

   echo $v;         // end of php code

?> </syntaxhighlight>