C program to find reverse of string using arrays without strRev

 


itstudentjunction


C program to find reverse of a string using arrays without strRev


reverse string in c

There are three ways to check reverse of a string:

1. check reverse of a string using arrays or 2. check reverse of a string using pointers
3. check reverse of a string using strRev




write a C program to find reverse of a string using arrays without strRev function


write a C program to reverse a string using arrays without strRev function / write a C program for reverse string


#include<stdio.h>
#include<string.h>
main()
{
char a[20] ;
printf("To check reverse of a given string using arrays without strRev \n");
printf("enter a string to reverse\n");
gets(a);
int len=strLen(a)
char temp;
for( i=0; i<len; i++)
{
temp=a[i];
a[i]=a[len];
a[len]=temp;
len--;
}
printf("\t ", a);
}




write a C program to reverse strings using arrays without strRev string function

write a program to find reverse of 10 strings using arrays without strRev function in c programming

#include<stdio.h>
#include<string.h>
main()
{
string b[20] ;
int i,j=0;
printf("To find for reverse N strings using arrays without strRev \n");
printf("enter N \n");
scanf("%d", N)
for(i=0;i<N;i++)
{
printf("enter a string to reverse\n");
gets(b[i]);
char c[20] =b[i];
printf("\n The reverse of string %d using arrays is :\t", a[i]);
int len=strLen(b[i])/2;
while(j<len)
{
temp=c[j];
c[j]=c[len];
c[len]=temp;
printf("%d", c[len] )
len--;
}
printf("\n" )

}

OUTPUT:

To find reverse N strings

enter a string to reverse

WRITE A C PROGRAM

the reverse of string WRITE A C PROGRAM using arrays is MARGORP C A ETIRW

enter a string to reverse

...........





write a C program to reverse N strings using arrays without strRev string function

write a c program to find reverse N strings using arrays without strRev function

#include<stdio.h>
#include<string.h>
main()
{
string a[20] ;
int i,j=0;
printf("To find reverse 10 strings using arrays without strRev \n");
for(i=0;i<10;i++)
{
printf("enter a string to reverse\n");
gets(a[i]);
char c[20] =a[i];
printf("\n The reverse of string %d using arrays is :\t", a[i]);
int len=strLen(a[i])/2;
while(j<len)
{
temp=c[j];
c[j]=c[len];
c[len]=temp;

len--;
}
for(i=0;i<strLen(a[i])
printf("%d", c[i] )
printf("\n" )

}

OUTPUT:

To find reverse 10 strings

enter a string to reverse

WRITE A PROGRAM IN C

the reverse of string WRITE A PROGRAM IN C using arrays is C NI MARGORP A ETIRW


enter a string to reverse

WAP

the reverse of string WAP using arrays is PAW

other string reverse programs


check reverse of string using pointers

check reverse of string using strRev

list of c programs



Most popular programs


write a program to find factorial using c
WAP to Calculate Simple Interest
Check for even / odd
perfect or not
sum of two matrices
display numbers pyramid
show amicable pairs
factors of a number using for loop, while
prime factors of integer using functions recursion
convert to uppercase
generater prime numbers using for loop
print pascal's Triangle using arrays
Write a C program to find reverse string using arrays
find string length strlen
Calculate compound Interest
Write a program to find armstrong number or not
print prime numbers using while
solve towers of hanoi
Display Floyd’s Triangle
reverse string using pointers
prime or not
Show revers number
calculate LCM concatinate strings using arrays
write a program to find palindrome or not
WAP to print sum of Digits
display transpose matrix
show lower triangle
multipiy two matrices
write a program to calculate GCD
strong number or not
find substring or not
string length using arrays
string length using pointers
convert to lowercase
WAP to find factors
count no.of digits
show inverse of matrix
show reverse string strrev
write a program to display upper triangle
concatinate strings strCat
convert to lowercase
check for palindrome string
substring position in a string
compare two strings arrays
compare strings strcmp
find roots of quadriaic expression
show fibonacci numbers
factorial using recurrsion
sum of factorial series
convert decimal to binary
Write a program to print armstrong numbers

decimal to octal
compare strings pointers
decimal to hexadecimal
sum of n numbers
average of n
largest of two
largest of n

strong numbers
perfect numbers using for loop

 



3

C Programs Data structures Programs in c Data structures Programs in c++ Unix commands Linux commands C++ programs Data structures Algorithms Java Programs UML Diagrams Assembly Language Programs DBMS j2ee programming