₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,615 members, 8,422,863 topics. Date: Monday, 08 June 2026 at 10:39 PM

Toggle theme

Urgent! Plz Help - C Programming Problem - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingUrgent! Plz Help - C Programming Problem (1285 Views)

1 Reply (Go Down)

Urgent! Plz Help - C Programming Problem by lctewand(op): 11:41am On Dec 21, 2009
plz i need an urgent solution to this question,


" write a program tha enteres a line of text, stores it in an array and then displays it backwards, allow the lenght of the line to be unspecified but assume it will not exceed 80 characters and it should be ended by pressing the enter key, "

plz guyz i really need ur help cos i dont even hav an idea of where to start from,
Re: Urgent! Plz Help - C Programming Problem by Ogim: 1:39pm On Dec 21, 2009
#include <stdio.h>
#include <string.h>

int _getch(void);

Void main()
{
char str[80];
int len;
scanf("%s",str);
len=strlen(str);
int i,j;
char temp;
for (i=0,j=len-1;i<j;i++,j--)
{
temp=str[i];
str[i]=str[j];
str[j]=temp;
}
printf(str);
_getch();
}
Re: Urgent! Plz Help - C Programming Problem by Ogim: 1:41pm On Dec 21, 2009
#include <stdio.h>
#include <string.h>

int _getch(void);

Void main()
{
char str[80];
int len;
scanf("%s",str);
len=strlen(str);
int i,j;
char temp;
for (i=0,j=len-1;i<j;i++,j--)
{
temp=str[i];
str[i]=str[j];
str[j]=temp;
}
printf(str);
_getch();
}
Re: Urgent! Plz Help - C Programming Problem by candylips(m): 3:12pm On Dec 21, 2009
@poster

you should be doing your home work assignment yourself smiley
Re: Urgent! Plz Help - C Programming Problem by lctewand(op): 10:30pm On Dec 21, 2009
@ candylips
thanks but i didnt know what 2 do so i had 2 come 2 d masters grin
@ ogim thanks a lot
am running it now nd i think its correct cos its only givin me 1 error which i think is due 2 my compiler,
Re: Urgent! Plz Help - C Programming Problem by javalove(m): 2:09pm On Dec 25, 2009
that question is from "k&r", if your lecturer gave you the question, he must be lazy or he wants you all to pass.
Re: Urgent! Plz Help - C Programming Problem by lctewand(op): 7:57am On Dec 30, 2009
javalove:
that question is from "k&r", if your lecturer gave you the question, he must be lazy or he wants you all to pass.
sorry what is k&r huh
Re: Urgent! Plz Help - C Programming Problem by Ogim: 9:38am On Dec 30, 2009
Kernighan & Ritchie also known as K & R where the once who design the original c language.
If you realy want to learn c programming start with the free books at
http://cslibrary.stanford.edu/
1 Reply

Help: C Language And MPI ? (urgent Plz)C Programming Challenge To Be Solved Under 10 Minutes234

I Just Wrote Ranksheet Html Exam And I Got 76%DeletedDear Programmers, Win N3.25million In The Google App Developers Challenge 2012