C
C#4mo ago
omer1🎗

Char help

What is the problem here I need to Write a program that accepts a character as input and prints the characters in 3-character increments.
No description
16 Replies
mg
mg4mo ago
because of the compiler error, what you're running is not your current code i don't quite understand the problem statement either "prints the characters in 3-character increments" what characters? does it give an example output?
omer1🎗
omer1🎗OP4mo ago
i am putting a character from the abc and it adds 3 letter to it until it hit the last charcter probably x,y,z
mg
mg4mo ago
could you post the last code that ran without errors?
omer1🎗
omer1🎗OP4mo ago
wdym?
mg
mg4mo ago
. the screenshot you posted is not the code that's being run i.e. it's not the code that's generating that output
omer1🎗
omer1🎗OP4mo ago
No description
mg
mg4mo ago
so let's start by going back to the code that produced that output do you see that red underline? that code will not build and run
omer1🎗
omer1🎗OP4mo ago
under ch += 3?
mg
mg4mo ago
yes
omer1🎗
omer1🎗OP4mo ago
yes i know i dont understand what is wrong though
mg
mg4mo ago
the error reads that you can't implicitly convert from an int to a char
omer1🎗
omer1🎗OP4mo ago
because 3 is and number and not a charcter, right?
mg
mg4mo ago
yep so you can explicitly convert 3 to a char with a cast (char)3
omer1🎗
omer1🎗OP4mo ago
oh what thanks very much man
mg
mg4mo ago
sure thing
omer1🎗
omer1🎗OP4mo ago
have a good day🙏🏾

Did you find this page helpful?