473,396 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Factorial of 100 with String? How to?

Hello, I can't figure out how to count the factorial of 100. I have a task to do, it is called: Count the factorial of 100, and sum every second number of that factorial. So this is my "culmination" :D

Expand|Select|Wrap|Line Numbers
  1. public class Main {
  2.  
  3.  
  4.     public static void main(String[] args) {
  5.     int skaicius = 1;
  6.     int q = 1;
  7.     String fakt = "";
  8.     String suma = "";
  9.     for (int i=0; i<10; i++)
  10.         {
  11.         skaicius += 1;
  12.         q *= skaicius;
  13.  
  14.         System.out.println("Faktorialas "+skaicius+" = "+q);
  15.     }
  16.  
  17. }
  18. }
  19.  
I can't figure out how to do it, can some one help me? :]

P.S.
Some english equivalents.
skaicius = number;
faktorialas = factorial;
suma = sum;

And sorry for my bad English :].
Mar 22 '11 #1
1 2941
sanat
5
Do u mean that if the factorial is 1048498 u ve to get 9+8+0...
Apr 14 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

33
by: patrick_woflian | last post by:
hey guys, im just writing a basic calculation at the moment, before building on it for an A-Level piece of work. i can add/divide etc... two numbers together yet i am having a major problem with...
35
by: aNt17017 | last post by:
This is my code: long fact(int n) { if (n == 0) return(1); if(n > 100) { printf("\t\tERROR: %d is too large for factorial.\n", n); return 1;
17
by: anurag | last post by:
hey can anyone help me in writing a code in c (function) that prints all permutations of a string.please help
8
by: salman | last post by:
this program is giving compile time error. so plse ge me the logic of factorial # include <iostream.h> # include <math.h> void main() { int f,sum=0,i,j,n; cout<<"\nEnter Number: ";
18
by: cess | last post by:
i think this is not right!!!! import java.io.*; public class factorial{ public static void main (String args)throws Exception { String number; int numberInteger; int n;
59
by: Umesh | last post by:
i wrote the following program to calculate factorial: #include<stdio.h> #include<iostream.h> void main() { int i,n; long int p=1; // or long double p=1; for exponential result which I don't...
3
by: Sugandh Jain | last post by:
Hi. How to write a function that will return me the factorial (say in a string) for the any positive integer it takes? When we find a factorial of even say 2000 or a higher number, it will be...
12
by: dynamo | last post by:
Hello everyone,i am a beginner in c++ and i am trying to write a program that outputs the factorial of a number in my own way,however i don't know why it's not working.Thanks for any help.This is the...
0
kadghar
by: kadghar | last post by:
Hi, I saw that Killer posted a simple Factorial Function that allows you to calculate up to 13!, well, you can use this for bigger numbers by changing the variable type. Why is this? You can...
2
by: becky808 | last post by:
Hi, I'm trying to write a program to calculate n factorial but it won't compile. Can anyone tell me what I'm doing wrong? #include <iostream> #include <cmath> using namespace std; int...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.