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 an endless loop?

796


What are the advantages of using macro in c language?

585


What is the use of bitwise operator?

679


What is call by value in c?

550


Using which language Test cases are added in .ptu file of RTRT unit testing???

3577






What is a list in c?

610


What is structure in c language?

610


How do I send escape sequences to control a terminal or other device?

602


What is #include stdlib h?

608


Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

637


What are structural members?

564


Write a program to reverse a linked list in c.

635


Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon

5458


we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above

629


Explain the red-black trees?

600