Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added reverse.dart #461

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ About: I'm moslem programmer<br/>
Programming Language: Java, kotlin, flutter<br/>
Email: [email protected]<br/>


Name: [Jahnavi Gupta.](https://github.com/janvig)<br/>
Place: Gandhinagar, India<br/>
About: I'm pursuing BTech in ICT at DA-IICT<br/>
Programming Language: Java, C, C++, MATLAB, dart<br/>
Email: [email protected]<br/>


Name: [Utkarsh Garg](https://github.com/utkarsh22garg)<br/>
Place: Allahabad,India<br/>
About: I'm pursuing 3rd year from MNNIT Allahbad<br/>
Expand Down
14 changes: 14 additions & 0 deletions factorial/factorial.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
int factorial(int n)
{
int fact=1;
for(int i=1;i<=n;i++)
fact=fact*i;
return fact;
}
void main()
{
int fac=factorial(4);
print('factorial ${fac}');
}


6 changes: 6 additions & 0 deletions random number/random.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import java.util.Random;
void main()
{
Random rand = new Random();
int n = rand.nextInt(50) + 1;
}
19 changes: 19 additions & 0 deletions reverse/reverse.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
int reverse(int n)
{
int rev=0;
while(n!=0)
{
int p=n%10;
int q=n-p;
rev=rev*10+p;
n= (q/10).floor();
}
return rev;

}
void main()
{
int r=reverse(87852);
print('reverse ${r}');
}