top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

How do I take large numbers of input around 100000 digits in length in C/C++?

0 votes
93 views
How do I take large numbers of input around 100000 digits in length in C/C++?
posted Jul 24, 2017 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
Store it as a string, As there is no such data type available which can store 100000 digits

1 Answer

0 votes
#include <string>
#include <sstream>
#include <ostream>
#include<conio.h>
#include <iostream>
#include <fstream>

using namespace std;

int main(){
stringstream str;

for (unsigned long n = 0; n < 100000; n++){
str << i;
}

std::ofstream outFile;
outFile.open("E://textcheck.txt");

outFile << "Welcome queryhome"+str.str();

getch();
return 0;
}
answer Jul 25, 2017 by Ajay Kumar
Similar Questions
+1 vote

Write your own rand function which returns random numbers in a given range(input) so that the numbers in the given range is equally likely to appear.

+3 votes

Given input as a string, return an integer as the sum of all numbers found in the string

Input: xyzonexyztwothreeeabrminusseven
Output : 1 + 23 + (-7) = 17

+3 votes

With different bases i.e. 10, 8, 16, etc; I'm trying to count the number of characters in each number.

Example

Number: ABCDEF
Number of digits: 6

Any sample or pointer for C?

+1 vote

Consider an implementation of Strings consisting of an array where the first element of the array indicates the length of the String and the next elements represent the value of the ASCII characters in the String.
Implement String concatenation of such scenario using C?

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...