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


Please Help Members By Posting Answers For Below Questions

What are the types of i/o functions?

671


Do you know the purpose of 'register' keyword?

638


What is the difference between a free-standing and a hosted environment?

634


What is the purpose of 'register' keyword in c language?

618


How is actual parameter different from the formal parameter?

583






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

719


What's the difference between constant char *p and char * constant p?

649


Are pointers integer?

543


What is difference between array and pointer in c?

532


Difference between MAC vs. IP Addressing

632


Who invented b language?

905


How will you delete a node in DLL?

675


Explain how can I pad a string to a known length?

640


What is the difference between call by value and call by reference in c?

610


What is the difference between struct and typedef struct in c?

640