Showing posts with label source code. Show all posts
Showing posts with label source code. Show all posts

Friday, December 16, 2011

PL/SQL Sample Examples

Hello Friends, here discuss some sample examples related to PL/SQL programming language. These all are basic example to understand PL/SQL syntax.
I used oracle 10g during program development. There are program to understand declare statement, loop concept, procedure, function, exception handling, cursor etc.


PL/SQL Sample Examples List

1. PL/SQL Example to find average of three numbers

2. PLSQL Example Find Even Odd Number

3. PL/SQL program to generate Fibonacci series

4. Check Number is Armstrong in PL/SQL Programming

5. PL/SQL Program to reverse a string

6. Basic LOOP Program in PL/SQL

7. PLSQL FOR Loop Example

8. Reverse a Number in PL/SQL Programming

9. PL/SQL Procedure Sample Example

10. Function Example in PL/SQL Oracle

11. Exception Handling Program in PL/SQL Oracle

Hope, these sample programs help you to understand PL/SQL programming language.

Thursday, December 15, 2011

C Program to String Reverse

It is a basic C program to reverse a string.
In this c programming example user input a string and get reverse of accepted string.

Aim - C program to reverse accepted string [Using strrev function]


Program Code
//String Reverse using strrev function
#include"stdio.h"
#include"conio.h"
#include"string.h"
void main()
{
   char str[20];
   clrscr();
   printf("********* String Reverse Using strrev Function *******\n");
   printf("Enter a string:  ");
   gets(str);
   strrev(str);
   printf("\n Reverse string is:  %s",str);
   getch();
}
Output




Aim - C program to reverse accepted string [without using strrev function]


Program Code
//String Reverse without using strrev function
#include"stdio.h"
#include"conio.h"
#include"string.h"
void main()
{
 char str1[20],str2[20];
 int i,j=0;
 clrscr();
 printf("***********String Reverse*********\n");
 printf("Enter String:");
 gets(str1);
 for(i=strlen(str1)-1;i>=0;i--,j++)
 {
  str2[j]=str1[i];
 }
 str2[j]=NULL;
 printf("\nReverse String is:");
 puts(str2);
 getch();
}

Output