Jump to content

Computing Help


Camels

Recommended Posts

Could anybody help me with my computing homework?

I need to write a programme that will revert the input (the input has to be a name)

For example;

input; Luke

output; ekuL

Probably extremly simple, I'm just a newfag to programming and my teacher won't help ;-;

Link to comment

You haven't told us what language?

idk.. I've learnt to code in VisualVasics using Console Application. I'M A NEWFAG. What languages are there? 3:

Link to comment

You haven't told us what language?

idk.. I've learnt to code in VisualVasics using Console Application. I'M A NEWFAG. What languages are there? 3:

You learn programming but your teacher doesn't tell you what language and you don't know?

Link to comment

Only know bits of java, C++, PHP and a very minimal bit of python. Looks like you're using the language Visual Basics? Something I've never heard of. You need to give more details if you want help my friend. Also don't use the name Luke in vain.

Link to comment

You haven't told us what language?

idk.. I've learnt to code in VisualVasics using Console Application. I'M A NEWFAG. What languages are there? 3:

You learn programming but your teacher doesn't tell you what language and you don't know?

Basic apparently

Link to comment

Only know bits of java, C++, PHP and a very minimal bit of python. Looks like you're using the language Visual Basics? Something I've never heard of. You need to give more details if you want help my friend. Also don't use the name Luke in vain.

I would never do so, oh lord Luke.

Link to comment

Much obliged.

2 different ways to do what you're trying using C, didn't execute or troubleshoot them so you're on your own for that

[color=#000000][font=Tahoma, Helvetica, sans-serif][size=3]#include<stdio.h>[/size][/font][/color]
[color=#000000][font=Tahoma, Helvetica, sans-serif][size=3]#include<string.h>[/size][/font][/color]
[color=#000000][font=Tahoma, Helvetica, sans-serif][size=3]main()[/size][/font][/color]
[color=#000000][font=Tahoma, Helvetica, sans-serif][size=3]{[/size][/font][/color]
[color=#000000][font=Tahoma, Helvetica, sans-serif][size=3] char str[50],revstr[50];[/size][/font][/color]
[color=#000000][font=Tahoma, Helvetica, sans-serif][size=3] int i=0,j=0;[/size][/font][/color]
[color=#000000][font=Tahoma, Helvetica, sans-serif][size=3] printf("Enter the text string: ");[/size][/font][/color]
[color=#000000][font=Tahoma, Helvetica, sans-serif][size=3] scanf("%s",str);[/size][/font][/color]
[color=#000000][font=Tahoma, Helvetica, sans-serif][size=3] for(i=strlen(str)-1;i>=0;i--)[/size][/font][/color]
[color=#000000][font=Tahoma, Helvetica, sans-serif][size=3] {[/size][/font][/color]
[color=#000000][font=Tahoma, Helvetica, sans-serif][size=3] revstr[j]=str[i];[/size][/font][/color]
[color=#000000][font=Tahoma, Helvetica, sans-serif][size=3] j++;[/size][/font][/color]
[color=#000000][font=Tahoma, Helvetica, sans-serif][size=3] }[/size][/font][/color]
[color=#000000][font=Tahoma, Helvetica, sans-serif][size=3] revstr[j]='\0';[/size][/font][/color]
[color=#000000][font=Tahoma, Helvetica, sans-serif][size=3] printf("Input String : %s",str);[/size][/font][/color]
[color=#000000][font=Tahoma, Helvetica, sans-serif][size=3] printf("\nOutput String : %s",revstr);[/size][/font][/color]
[color=#000000][font=Tahoma, Helvetica, sans-serif][size=3] getch();[/size][/font][/color]
[color=#000000][font=Tahoma, Helvetica, sans-serif][size=3]}

[/size][/font][/color]

[/size][/font][/color][color=gray][font=Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace][size=1]#include<stdio.h>[/size][/font][/color]
[color=#000000][font=Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace]
void reverse(void)[/font][/color][color=#000000][font=Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace]
{[/font][/color][color=#000000][font=Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace]
char c;[/font][/color][color=#000000][font=Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace]
if((c = getchar()) != '\n'){ reverse(); }[/font][/color][color=#000000][font=Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace]
putchar(c);[/font][/color][color=#000000][font=Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace]
return;[/font][/color][color=#000000][font=Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace]
}[/font][/color]
[color=#000000][font=Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace]
int main(void)[/font][/color][color=#000000][font=Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace]
{[/font][/color][color=#000000][font=Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace]
printf("Enter the text string below:n");[/font][/color][color=#000000][font=Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace]
reverse();[/font][/color][color=#000000][font=Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace]
putchar('\n');[/font][/color][color=#000000][font=Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace]
}
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members, 0 Anonymous, 0 Guests

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.