Robert Briggs
Feb 11th, 2001, 07:43 AM
I am new to C and I am doing a course in VB but I have to understand C first I know you will not do my homework for me but can someone please give me a clue
This is a question I am on with I have input two characters and show the characters from lowest to highest and highest to lowest
this is my code at pres
/*characters.c*/
#include <stdio.h>
void main ()
{
char ch1,ch2,loop,lowest highest,
printf("Enter two characters >");
scanf("%c%c",&lowest,&highest);
ch1 = 0;
ch2 = 127;
if (ch1 <= ch2)
for(loop = lowest;loop <=highest;loop++)
printf("%c",loop);
if (ch1 >= ch2)
for(loop = highest;loop >= lowest;loop++);
printf("%c",loop);
}
This is a question I am on with I have input two characters and show the characters from lowest to highest and highest to lowest
this is my code at pres
/*characters.c*/
#include <stdio.h>
void main ()
{
char ch1,ch2,loop,lowest highest,
printf("Enter two characters >");
scanf("%c%c",&lowest,&highest);
ch1 = 0;
ch2 = 127;
if (ch1 <= ch2)
for(loop = lowest;loop <=highest;loop++)
printf("%c",loop);
if (ch1 >= ch2)
for(loop = highest;loop >= lowest;loop++);
printf("%c",loop);
}