-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_1_Loops_Question.java
More file actions
39 lines (35 loc) · 905 Bytes
/
Copy path_1_Loops_Question.java
File metadata and controls
39 lines (35 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package dsa;
import java.util.Scanner;
public class _1_Loops_Question {
public static void main(String[] args) {
//Fibonachi Number
/* Scanner sc=new Scanner(System.in);
int n= sc.nextInt();
int a=0;
int b=1;
int count =2;
while (count<=n){
int temp=b;
b=b+a;
a=temp;
count++;
}
System.out.println(b);
*/
//counting number
int num=45535;
int count1 =0;
while (num>0){
int rem =num%10;
if (rem==5){
count1++;
}
num=num/10;
}
System.out.println(count1);
//////////////////////////////////////////////////////////////////////////////
int f =455544;
System.out.println(f%10);
System.out.println(f/10);
}
}