πJava Variable:
1, Variable is the name of a memory location in which we can store the value.
2, The variable value can be change.
3, A variable is defined by combining an identifier, data types, and an initializer.
4, The first character in the variable name must be an alphabet, underscore, a digit, or a dollar sign. 5, All variables have a scope
6, The identifier is the name of the Variable.
7, Commas or blanks are not used inside a variable name.
πJava Variable Declaration Syntax :
Type Variable name;
int is a type
a ,b and a*b is a variable-name
Java variable declaration syntax Rules:
Type Variable name:
int Roll_No; //Roll_No declare a Variable
float Percentage; //Percentage declare a Variable
Roll_No=40 ; //assigns value in variable
Precentege=40.80; //assigns value in variable
How to Declare a variables in Java?
The Variables are declared in various types:
int abc;// this declare a variable
int abc;// (abc and a_bc are a variable)
int a,b,x,z;// (a,b,x,z) are a variable
byte a1=40;//initialize a.
double a2=40.80 ;//like a float
Char a3=βramβ;//a variable gain value ( ram )
Q-Addition of Variables Java Example?
int a,b,c,d;
a=10; b=20; c=30; d=40;
System.out.println(a+b+c+d);
Output :
100
Q-Variable increment values in Java?
int a=10;// a is a Variable
a+=40;
a=a+20;
System.out.println(a);
Output :
70
Q-Create a variable and store a no inside this variable and print output?
int a;
a=40;
OR
int a=40;
System.out.println(a);
int a;
a=40;
Output :
40
Q-Create a string variable and store a no inside string type variable and print output?
String a="Ram ";
String b="Lakshman ";
OR
String a,b;
a="Ram ";
b="Lakshman ";
System.out.println(a+b);
Output :
RamLakshman
Constant:
Constant is used when you store a value inside a variable, but use Constant after you canβt overwrite the existing deal.
1, Variable is the name of a memory location in which we can store the value.
2, The variable value can be change.
3, A variable is defined by combining an identifier, data types, and an initializer.
4, The first character in the variable name must be an alphabet, underscore, a digit, or a dollar sign. 5, All variables have a scope
6, The identifier is the name of the Variable.
7, Commas or blanks are not used inside a variable name.
πJava Variable Declaration Syntax :
Type Variable name;
int is a type
a ,b and a*b is a variable-name
Java variable declaration syntax Rules:
Type Variable name:
int Roll_No; //Roll_No declare a Variable
float Percentage; //Percentage declare a Variable
Roll_No=40 ; //assigns value in variable
Precentege=40.80; //assigns value in variable
How to Declare a variables in Java?
The Variables are declared in various types:
int abc;// this declare a variable
int abc;// (abc and a_bc are a variable)
int a,b,x,z;// (a,b,x,z) are a variable
byte a1=40;//initialize a.
double a2=40.80 ;//like a float
Char a3=βramβ;//a variable gain value ( ram )
Q-Addition of Variables Java Example?
int a,b,c,d;
a=10; b=20; c=30; d=40;
System.out.println(a+b+c+d);
Output :
100
Q-Variable increment values in Java?
int a=10;// a is a Variable
a+=40;
a=a+20;
System.out.println(a);
Output :
70
Q-Create a variable and store a no inside this variable and print output?
int a;
a=40;
OR
int a=40;
System.out.println(a);
int a;
a=40;
Output :
40
Q-Create a string variable and store a no inside string type variable and print output?
String a="Ram ";
String b="Lakshman ";
OR
String a,b;
a="Ram ";
b="Lakshman ";
System.out.println(a+b);
Output :
RamLakshman
Constant:
Constant is used when you store a value inside a variable, but use Constant after you canβt overwrite the existing deal.
Good Morning All,
New Post on Instagram
πCheck π out πthis
What is Cookies in JavaScript
https://www.instagram.com/p/Cr2E2KTBUS5/?utm_source=ig_web_copy_link
New Post on Instagram
πCheck π out πthis
What is Cookies in JavaScript
https://www.instagram.com/p/Cr2E2KTBUS5/?utm_source=ig_web_copy_link
10 Subreddits You must Join on Reddit if you are a Data Science, Machine Learning, Deep Learning or Artificial Intelligence Enthusiast :
01. reddit.com/r/datascience/
02. reddit.com/r/MachineLearning/
03. reddit.com/r/learnmachinelearning/
04. reddit.com/r/LanguageTechnology/
05. reddit.com/r/deeplearning/
06. reddit.com/r/datasets/
07. reddit.com/r/visualization/
08. reddit.com/r/dataisbeautiful/
09. reddit.com/r/learnpython/
10. reddit.com/r/rstats/
01. reddit.com/r/datascience/
02. reddit.com/r/MachineLearning/
03. reddit.com/r/learnmachinelearning/
04. reddit.com/r/LanguageTechnology/
05. reddit.com/r/deeplearning/
06. reddit.com/r/datasets/
07. reddit.com/r/visualization/
08. reddit.com/r/dataisbeautiful/
09. reddit.com/r/learnpython/
10. reddit.com/r/rstats/
Reddit
Data Science
A space for data science professionals to engage in discussions and debates on the subject of data science.
What is Pseudocode?
πππͺππ
https://www.instagram.com/p/Cr7youYB-6H/?utm_source=ig_web_copy_link
πππͺππ
https://www.instagram.com/p/Cr7youYB-6H/?utm_source=ig_web_copy_link
computer flowchart
ππππππ
https://www.instagram.com/p/Cr8FN22hPtT/?utm_source=ig_web_copy_link
ππππππ
https://www.instagram.com/p/Cr8FN22hPtT/?utm_source=ig_web_copy_link
πͺ10 AI tools you cannot miss in 2023πͺ
ππ»1. Writing β Textblaze.me/ai
ππ»2. Logo β AppIcons.ai
ππ»3. Design β StockImg.ai
ππ»4. Code β TelePortHQ.io
ππ»5. Video β Elai.io
ππ»6. Images β Midjourney.com
ππ»7. Slides β Sendsteps.com
ππ»8. Emails β Remail.ai
ππ»9. Website β Hocoos.com
ππ»10. Meeting β Otter.ai
for more info
subscribe my youtube channel #coderbaba
and join my Telegram @Coder_baba
ππ»1. Writing β Textblaze.me/ai
ππ»2. Logo β AppIcons.ai
ππ»3. Design β StockImg.ai
ππ»4. Code β TelePortHQ.io
ππ»5. Video β Elai.io
ππ»6. Images β Midjourney.com
ππ»7. Slides β Sendsteps.com
ππ»8. Emails β Remail.ai
ππ»9. Website β Hocoos.com
ππ»10. Meeting β Otter.ai
for more info
subscribe my youtube channel #coderbaba
and join my Telegram @Coder_baba
15_must_know_coding_patterns.pdf
3.1 MB
Subscribe toππ» "CODER BABA" YouTube channel β¨ for coding, programming, software related content π―π―
πTop 10 Github Repositories For Web Developerπ
1. Web Developer-Roadmap : https://github.com/kamranahmedse/developer-roadmap
2. 30-Seconds-Of-Code : https://github.com/30-seconds/30-seconds-of-code
3. Awesome-Cheatsheets : https://github.com/LeCoupa/awesome-cheatsheets
4. CSS-Protips : https://github.com/AllThingsSmitty/css-protips
5. 33-JS-Concepts : https://github.com/leonardomso/33-js-concepts
6. You-Dont-Know-JS : https://github.com/getify/You-Dont-Know-JS/tree/2nd-ed
7. Front-End-Checklist : https://github.com/thedaviddias/Front-End-Checklist
8. Javascript-Questions : https://github.com/lydiahallie/javascript-questions
9. Clean-Code-Javascript : https://github.com/ryanmcdermott/clean-code-javascript
10. free-programming-books : https://github.com/EbookFoundation/free-programming-books
π Subscribe toππ» "CODER BABA" YouTube channel β¨ for coding, programming, software related content π―π―π
1. Web Developer-Roadmap : https://github.com/kamranahmedse/developer-roadmap
2. 30-Seconds-Of-Code : https://github.com/30-seconds/30-seconds-of-code
3. Awesome-Cheatsheets : https://github.com/LeCoupa/awesome-cheatsheets
4. CSS-Protips : https://github.com/AllThingsSmitty/css-protips
5. 33-JS-Concepts : https://github.com/leonardomso/33-js-concepts
6. You-Dont-Know-JS : https://github.com/getify/You-Dont-Know-JS/tree/2nd-ed
7. Front-End-Checklist : https://github.com/thedaviddias/Front-End-Checklist
8. Javascript-Questions : https://github.com/lydiahallie/javascript-questions
9. Clean-Code-Javascript : https://github.com/ryanmcdermott/clean-code-javascript
10. free-programming-books : https://github.com/EbookFoundation/free-programming-books
π Subscribe toππ» "CODER BABA" YouTube channel β¨ for coding, programming, software related content π―π―π
π PYTHON CODE FOR NUMBER GUESSING GAME π
import random
import math
lower = 0
upper = 100
x = random.randint(lower, upper)
limit = round(math.log(upper - lower + 1, 2))
print("\n\tYou've only ", limit, " chances to guess the integer!\n")
count = 0
while count <= limit:
count += 1
guess = int(input("Guess a number:- "))
if count == limit:
print("\n\tThe number is %d" % x)
print("\tBetter Luck Next time!")
break
if x == guess:
print("Congratulations you did it in ",count, " try")
break
elif x > guess:
print("You guessed too small!")
elif x < guess:
print("You Guessed too high!")
π Hope you guys liked it @Coder_baba