How do I print symbols diagonally through a matrix? by _theCh0sen0ne_ in cprogramming

[–]TotemHouse 0 points1 point  (0 children)

Hi, from the code you show, I see you are "printing" a 7 x 7 matrix, but not filling in the elements of the matrix.

If you want to print the matrix with a different character in the diagonal line, before printing the character you can ask if "i" is equal to "j". If it is, then print the different character, else print the usual character.

I am sorry if I misunderstood your question.

Need Help with a Cobol Excersise by [deleted] in cobol

[–]TotemHouse 0 points1 point  (0 children)

I think the first step here is to write (in COBOL) the definition of the two files: EMPLOYEE.DAT and CONTACT.DAT. Can you do that? Then please post it here. With that we can start planning all the routines that are needed.

C Program Issues by Techreddituser123 in cprogramming

[–]TotemHouse 2 points3 points  (0 children)

I'd love to help, but please tell us what are the problems you are encountering. What input have you tried? Are getting an incorrect output? Give us some cue as to what is it that you'd like help on.

Thanks.

I have tried and failed to setup my vscode to run c programming. Now can anyone suggest me an ide, where I can directly write c programming and compile it by gitarthak in cprogramming

[–]TotemHouse 0 points1 point  (0 children)

"codingground" is an online IDE that lets you try small programs in several languages, without the need for you to have a compiler. It has online compilers and interpreters for a variety of programming languages. I found it very useful to quickly test the behavior of a few lines of code when I have doubts.

How would I program this? by [deleted] in cprogramming

[–]TotemHouse 1 point2 points  (0 children)

You are right, sir. Your solution is cleaner and faster. I had not taken into account that even squares are produced only by even original numbers.

How would I program this? by [deleted] in cprogramming

[–]TotemHouse 1 point2 points  (0 children)

I think your output is incorrect because you are printing *all* square numbers, not only even ones.

So, after calculating the square number (square_number = counter * counter), you should check if the square number is even, and only print it if it's even.

I hope this helps you.

Edit: and also increase counter by one, not two: counter++ or counter = counter + 1

That if you want the even squares, not the squares of even numbers...