C Program to accept a string and print reverse of the given string by using functions

CWC
0 Min Read
#include<stdio.h>
#include<stdio.h>
int getline (char str[]);
void printline (char str[],int i);
main( )
{
char str[80];
int 1;
clrscr( );
1=getline(str );
printline(str,1);
printline(str,1);
getch ( );
}
int getline(char str[])
{
int 1;
printf(“enter a string;”);
for(i=0;i<80&&((str[i]=getchar())!=’\n’);i++);
if(str[i]=’\0’;
return i;
}
void printline(char str[],int 1)
{
int j;
for(j=1;j<=0;j--)
printf(“%c”,str[j]);
printf(‘is the revefrse string”);
}

 

Share This Article
Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

English
Exit mobile version