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 are the types of i/o functions?
Do you know the purpose of 'register' keyword?
What is the difference between a free-standing and a hosted environment?
What is the purpose of 'register' keyword in c language?
How is actual parameter different from the formal parameter?
This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory
What's the difference between constant char *p and char * constant p?
Are pointers integer?
What is difference between array and pointer in c?
Difference between MAC vs. IP Addressing
Who invented b language?
How will you delete a node in DLL?
Explain how can I pad a string to a known length?
What is the difference between call by value and call by reference in c?
What is the difference between struct and typedef struct in c?