Write c-code for 5+55+555+5555+55555+555555+5555555.
Output will be it's answer...
Answer Posted / ashish
#include<stdio.h>
#include<math.h>
void main()
{ long int f=0,ans=0,i;
clrscr();
for(i=0;i<7;i++)
{
f=f*10+5;
ans+=f;
}
printf("%ld",ans);
getch();
}
| Is This Answer Correct ? | 19 Yes | 8 No |
Post New Answer View All Answers
What do the functions atoi(), itoa() and gcvt() do?
what is the difference between 123 and 0123 in c?
Is file a keyword in c?
Why c language?
Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?
what is the difference between class and unio?
What are void pointers in c?
Explain how to reverse singly link list.
What is the difference between mpi and openmp?
What does struct node * mean?
Why can’t constant values be used to define an array’s initial size?
How does pointer work in c?
How can I insert or delete a line (or record) in the middle of a file?
Stimulate calculator using Switch-case-default statement for two numbers
Are pointers integers in c?