#include<stdio.h>
void reverse(char*,int,int);
int main()
{
char a[100];
gets(a);
reverse(a,0,strlen(a)-1);
printf("%s\n",a);
return 0;
}
void reverse(char *x,int i,int j)
{
char c;
if(i>=j)
return;
c=*(x+i);
*(x+i)=*(x+j);
*(x+j)=c;
reverse(x,++i,--j);
}
Enjoy learning new things and you want to get as good a grip as possible on how things work and best ways to use information technology. Visit my other blogs here:: http://thissasinfobahn.blogspot.com/:: http://thissann.blogspot.com/:: http://thissanetworkz.blogspot.com/
Monday, March 23, 2015
Monday, March 16, 2015
Monday, March 9, 2015
Cryptography
Cryptography
is the practice and study of hiding information. It is also called the code,
but this is not really a good name. It is a science that is used to keep the
information confidential and secure. Modern cryptography is a mix of
mathematics, computer science and electrical engineering. Cryptography is used
in ATM (banking) cards, computer passwords, and shopping on the internet.
If
a message is sent is changed with cryptography (or encrypted) before it is
sent. The method of changing the text is a "code" or, rather, as a “cipher”.
The amended text is "tagged”. The amendment makes the message difficult to
read. Someone who wants to read it should change back (or decrypt). How to
change back it's a secret. Both the individual sending the message and the one
who receives must change the secret way to know, but others may not. Studying
the cypher text called to discover the secret “cryptanalysis” or “cracking"
or sometimes “code breaking”.
Different
types of cryptography can be easier or harder to use and can be better or worse
hide the secret message. Figures use a "key" that is a secret hiding
secret messages. The cryptographic method does no secret. Different people may
have the same method, but using different keys so that they cannot read each others messages. Since Caesar cipher that so many keys as the number of
letters in the alphabet easily cracked by trying all the keys. Figures billions
of keys can be cracked by more complex methods.
References
Cryptography: Theory and Practice, Third Edition By Douglas R. Stinson
More Books
Tuesday, March 3, 2015
Sunday, March 1, 2015
Monday, February 23, 2015
Tuesday, February 17, 2015
Binary search implementation using C language
#include<stdio.h>
#include<conio.h>
#define MAX 20
int bsearch(int [],int,int,int);
void main()
{
int a[10],i,t,f=0,n,l,k;
int bsearch(int[],int,int,int);
clrscr();
printf("\n\nEnter the size of an array: ");
scanf("%d",&n);
if (n>MAX)
{
printf("\nInvalid Index\n");
}
else
{
printf("\nEnter the array elements:\n");
}
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
printf("\n\n Enter element for search: ");
scanf("%d",&t);
l=n-1;
k=bsearch(a,f,l,t);
if(k==-1)
{
printf("\n Element is not found\n");
}
else
{
printf("\n\nElement is found at location: %d",k);
}
getch();
}
int bsearch(int list[],int f,int l,int t)//Binary Search function implementation
{
int m;
while(f<=l)
{
m=(f+l)/2;
if(list[m]==t)
{
return m;
}
else if(t<list[m])
{
l=m-1;
}
else if(t>list[m])
{
f=m+1;
}
}
return(1);
}
#include<conio.h>
#define MAX 20
int bsearch(int [],int,int,int);
void main()
{
int a[10],i,t,f=0,n,l,k;
int bsearch(int[],int,int,int);
clrscr();
printf("\n\nEnter the size of an array: ");
scanf("%d",&n);
if (n>MAX)
{
printf("\nInvalid Index\n");
}
else
{
printf("\nEnter the array elements:\n");
}
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
printf("\n\n Enter element for search: ");
scanf("%d",&t);
l=n-1;
k=bsearch(a,f,l,t);
if(k==-1)
{
printf("\n Element is not found\n");
}
else
{
printf("\n\nElement is found at location: %d",k);
}
getch();
}
int bsearch(int list[],int f,int l,int t)//Binary Search function implementation
{
int m;
while(f<=l)
{
m=(f+l)/2;
if(list[m]==t)
{
return m;
}
else if(t<list[m])
{
l=m-1;
}
else if(t>list[m])
{
f=m+1;
}
}
return(1);
}
Linear Search Implementation Using C language
#include <stdio.h>
int linearsearch(int*,int,int);
int main()
{
int array[50],search,c,n,position;
clrscr();
printf("Enter thE number of elements in array\n");
scanf("%d",&n);
printf("Enter %d numbers\n",n);
for(c=0;c<n;c++)
scanf("%d",&array[c]);
}
printf("Enter the number to search\n");
scanf("%d",&search);
position=linersearch(array,n,search);
if(position==-1)
{
printf("%d is not present in array\n",search);
}
else
{
printf("%d is present at location %d\n",search,position+1);
}
getch();
return 0;
}
int linersearch(int *pointer,int n,int find)//Implementation of linersearch
function
{
int c;
for(c=0;c<n;c++)
{
if(*(pointer+c)==find)
{
return c;
}
}
return -1;
}
int linearsearch(int*,int,int);
int main()
{
int array[50],search,c,n,position;
clrscr();
printf("Enter thE number of elements in array\n");
scanf("%d",&n);
printf("Enter %d numbers\n",n);
for(c=0;c<n;c++)
scanf("%d",&array[c]);
}
printf("Enter the number to search\n");
scanf("%d",&search);
position=linersearch(array,n,search);
if(position==-1)
{
printf("%d is not present in array\n",search);
}
else
{
printf("%d is present at location %d\n",search,position+1);
}
getch();
return 0;
}
int linersearch(int *pointer,int n,int find)//Implementation of linersearch
function
{
int c;
for(c=0;c<n;c++)
{
if(*(pointer+c)==find)
{
return c;
}
}
return -1;
}
Subscribe to:
Posts (Atom)
-
මිනිසා කාර්යබහුල වීමත් සමගම තම කටයුතු පහසුවෙන් , වේගයෙන් කාර්යක්ශමව සිදුකරගැනීම සදහා විදුලි බලයෙන් ක්රියාකරනු ලබන විවිධාකාර උපකරණ භාවිත...
-
සයිබර් අපරාධ( Cybercrimes) භෞතික ලෝකය ස්වභාවධර්මයේ නිර්මාණයයක් වුවද සයිබර් අවකාශය මිනිසාගේ නිර්මාණයකි.භෞතික ලෝකයට සීමාමායිම් තිබුනද , සය...




