Display the ASCII characters. (Implement in do-while loop) with functions
can you show me what code you have done
and is it in C or java
c
ok
help me please T_T
ok give me a min
do you want to print all characters ?
yah thats what our teachers said
T_T
#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; }
its in while loop can you convert it in to do while() loop?
i dont know
T_T
ok
#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(); }
understand???
ill try it in turbo c
yes try it. if an problem occurs tell me ok :)
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(); }
bro, their is an error occur constant out of range in comparison in function what to do?
in this part "while(c<255);"
ok lemme see
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
your right i tryied lesser value it works..
thanks a lot bro got many more problems.. T___T
mention not i like to help :)
ill post it
Join our real-time social learning platform and learn together with your friends!