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
What is an endless loop?
What are the advantages of using macro in c language?
What is the use of bitwise operator?
What is call by value in c?
Using which language Test cases are added in .ptu file of RTRT unit testing???
What is a list in c?
What is structure in c language?
How do I send escape sequences to control a terminal or other device?
What is #include stdlib h?
Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
What are structural members?
Write a program to reverse a linked list in c.
Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon
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
Explain the red-black trees?