Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

A C program to add two very large numbers whose datatype is not specified?

+2 votes
asked Jul 24, 2019 by Tullu Singh
The numbers can be positive,negative or floating point but the result should display their sum.

2 Answers

0 votes
answered Jul 24, 2019 by anonymous
#include<stdio.h>

#define data long int

int main()

{

data n1,n2;

scanf("%d%d",&n1,&n2);

print("%d",(n1+n2));

return 0;

}
commented Aug 1, 2019 by kuelf
Ridiculous.
What is the point of #define here? Just write the type.
When you use %d, that refers to int. This means you're inputting and outputting int types.
Also long int and int are the same thing.
0 votes
answered Jul 26, 2019 by anonymous

#include<stdio.h>

#define data long int

int main()

{

data n1,n2;

scanf("%d%d",&n1,&n2);

print("%d",(n1+n2));

return 0;

}

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...