i've done the for loop for this code but finding the while loop and dowhile loop tricky i would be grateful if somebody can help me,
the while loop compiles but only the second character in the string is converted to uppercase the rest are not, the dowhile one does not compile completely wrong, below is what i have done so far, i can write the code in other formats but i need the ASCII values in the code thank you
Code:
//while loop
#include<stdio.h>
main(){
char text[20],a;
int i=1;
printf("Enter any text:\n");
scanf("%s",text);
while(i<=text[a],text[a]++);
{text[i]>=97&&text[i]<=122;
{text[i]=text[i]-32;
}
}
printf("The text in uppercase is: %s",text);
}
//dowhile
#include<stdio.h>
main(){
char text[20];
int i;
printf("Enter any text:\n");
scanf("%s",text);
do{
printf("The text in uppercase is: %s",text);
}while(i=0;i<=text[i];i++)
(text[i]>=97&&text[i]<=122)
text[i]=text[i]-32;
}