+ 1
any one find my error?
import java.util.*; // Compiler version JDK 11.0.2 class Dcoder { public static void main(String args[]) { int a; System.out.print("enter password:"); Scanner obj=new Scanner(System.in); a=obj.nextInt(); if(a=9) {System.out.println("enter successfull"); } } }
3 Answers
+ 2
In case of "if" statements there should be relational operators not an assignment operator.
specially in java if statement accept only Boolean value or those equation which will give boolean value as a condition.
if(a==9) //this is the correct statement....
+ 1
Pallavi Jha #python 2.7.15
letter='''Dear <|name|>,\n your are salected,Date <|date|>'''
name=input("enter yor name")
date=input("enter dalte")
letter=letter.replace("<|name|>",name)
letter=letter.replace("<|date|>",date)
print(letter)
+ 1
letter='''Dear <|name|>, your are salected,Date <|date|>'''
name=input("enter yor name \n")
date=input("enter dalte \n")
letter=letter.replace("<|name|>",name)
letter=letter.replace("<|date|>",date)
print("\n")
print(letter)