I am very new to programming so can someone please help with this problem.
I have managed to read a sentence into an array and changed all the characters to upper case now I have to move each character 3 places in the alphabet, so some kind of wrap around will be necessary. If you programme for a living don't worry about me stealing your job!!
Here is my code so far:
//Create an array.
//invite the user to key in a sentence.
//put the sentence into the array.
//Then using seperate functions....
//convert all the characters to upper case.
// encrypt the message by moving each character 3 places in the //alphabet.
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <ctype.h>
void main( int argc, char *argv[], char *envp[] )
{
char sentence[100];
printf ("Please enter a sentence and press enter:\n\n");
gets(sentence);
printf ("\nThe sentence you keyed in was:\n\n%s\n\n",sentence);
char *p;
for( p = sentence; p < sentence + strlen( sentence ); p++ )
{
if( islower( *p ) )
_putch( _toupper( *p ) );
else
_putch( *p );
}
}