Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write c-code for 5+55+555+5555+55555+555555+5555555.
Output will be it's answer...

Answer Posted / sunny

Hi Guys,

The answers above are correct but i was wondering if one has to add 5+55+555+.... till 'n'digits then??

Then the answer would be

#include<stdio.h>
#include<math.h>
void main()
{

long int res=0;
int n;
printf("The Maximum Digit(i.e. if youy want result upto 555 then enter '3'):");
scanf("%d",&n);

res= (5*pow(10,(n+1)) - 50 -(45*n))/81;
// VII standard maths
printf("%ld",res);
}


THANX

Is This Answer Correct ?    10 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between exit() and _exit() function?

1060


How can you be sure that a program follows the ANSI C standard?

1622


c program for searching a student details among 10 student details

2099


What is && in c programming?

1184


What is sizeof array?

1067


What is the difference between declaring a variable and defining a variable?

1292


what is the difference between class and unio?

2378


What do header files do?

1090


What is switch in c?

1120


How will you write a code for accessing the length of an array without assigning it to another variable?

1061


What is pass by reference in c?

1199


What is function pointer c?

1124


Dont ansi function prototypes render lint obsolete?

1144


Why is c called c?

1037


Explain the difference between malloc() and calloc() function?

1063