Translate

Thursday, June 4, 2015

Write a C program thar will enter a line of text, store in an array and then display it backwards.



#include<stdio.h>

void main()
{
    char line[80];
    int i, l=0;

    printf("Write a line: \n ");

    gets(line);

    l= strlen(line);

    for(i=l;i>=0; --i){
        printf("%c", line[i]);
    }
}



Download source code

0 comments:

Post a Comment