+ 2

Why this program show no output?Is there any technical problem in this codding programmer.

https://code.sololearn.com/c3XKynAAT43I/?ref=app if i make this same program in my laptop or computer then output coming is like a shape of heart..

2nd Mar 2018, 8:50 AM
Harsh Agrawal
Harsh Agrawal - avatar
9 Answers
+ 14
I know buddy , when i was in school ... i tried printing some characters there , they were showing "?"(upside down) , while they show solid blocks here //might thats the difference of output-playground here , 👉see whole table from 1 to 256 here using a loop & then use those characters wisely
2nd Mar 2018, 9:12 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 11
public class Program { public static void main(String[] args) { char c,c1; c= 3; c1= c; System.out.println("t"+c1+"t"); } } 👉try this , what u notice between those two t's , some space ... right ? //thats what c1 is
2nd Mar 2018, 8:55 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 10
it is printing some space //i know we can't see the space , therefore I putted two t's on both sides of the character it prints ... so we can see whether something is there or not ... ☝
2nd Mar 2018, 9:16 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 3
@gaurav agrawal if i try this in computer then output shows like a shape of heart if u dont beleive this then u can also try this and @sara every character has an integer value.if u write 65 in place of 3 them u get output A...
2nd Mar 2018, 9:07 AM
Harsh Agrawal
Harsh Agrawal - avatar
+ 2
because c and c1 do not have same data types . c is integer and c1 is character. you can not write char c,c1 you are saying both of them are characters but after that you put a number in c 😊
2nd Mar 2018, 8:56 AM
sarah
sarah - avatar
2nd Mar 2018, 10:06 AM
josh mizzi
josh mizzi - avatar
+ 1
thnx but why in this output show nothing??
2nd Mar 2018, 9:14 AM
Harsh Agrawal
Harsh Agrawal - avatar
+ 1
C should equal '3' not 3. The first is the char '3' while the second is an intager.
2nd Mar 2018, 9:56 AM
josh mizzi
josh mizzi - avatar
0
@joshi mizza every character has an integer value if u write in 65 in place of 3 then u get the output A but when i put 3 its show nothing but when i do same in computer(command prompt) then its show like a shape of heart.....thats why i asking this.
3rd Mar 2018, 3:39 PM
Harsh Agrawal
Harsh Agrawal - avatar