Ask your own question, for FREE!
Computer Science 16 Online
OpenStudy (anonymous):

Display the ASCII characters. (Implement in do-while loop) with functions

OpenStudy (anonymous):

can you show me what code you have done

OpenStudy (anonymous):

and is it in C or java

OpenStudy (anonymous):

c

OpenStudy (anonymous):

ok

OpenStudy (anonymous):

help me please T_T

OpenStudy (anonymous):

ok give me a min

OpenStudy (anonymous):

do you want to print all characters ?

OpenStudy (anonymous):

yah thats what our teachers said

OpenStudy (anonymous):

T_T

OpenStudy (anonymous):

#include<stdio.h> #include<conio.h> void main() { char c=0; while(c<255) printf("\n%d ascii value is %c",c,c); c=c+1; }

OpenStudy (anonymous):

its in while loop can you convert it in to do while() loop?

OpenStudy (anonymous):

i dont know

OpenStudy (anonymous):

T_T

OpenStudy (anonymous):

ok

OpenStudy (anonymous):

#include<stdio.h> #include<conio.h> void main() { char c=0; do{ printf("\n%d ascii value is %c",c,c); c=c+1; }while(c<255); getch(); } //in function form: #include<stdio.h> #include<conio.h> void ascii(void){ //function char c=0; do{ printf("\n%d ascii value is %c",c,c); c=c+1; }while(c<255); } void main() { ascii(); getch(); }

OpenStudy (anonymous):

understand???

OpenStudy (anonymous):

ill try it in turbo c

OpenStudy (anonymous):

yes try it. if an problem occurs tell me ok :)

OpenStudy (anonymous):

this one is the proper answer to your question program with function + do_while loop //in function form: #include<stdio.h> #include<conio.h> void ascii(void){ //function char c=0; do{ printf("\n%d ascii value is %c",c,c); c=c+1; }while(c<255); } void main() { ascii(); getch(); }

OpenStudy (anonymous):

bro, their is an error occur constant out of range in comparison in function what to do?

OpenStudy (anonymous):

in this part "while(c<255);"

OpenStudy (anonymous):

ok lemme see

OpenStudy (anonymous):

oh its not error its a warning. but its ok program is working accurately. warning is because 255 is a huge number no worries its ok

OpenStudy (anonymous):

your right i tryied lesser value it works..

OpenStudy (anonymous):

thanks a lot bro got many more problems.. T___T

OpenStudy (anonymous):

mention not i like to help :)

OpenStudy (anonymous):

ill post it

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!