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
Write the control statements in C language
What are the difference between a free-standing and a hosted environment?
a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f
How to declare a variable?
What are identifiers and keywords in c?
Write a program to print ASCII code for a given digit.
Is c is a high level language?
What is struct node in c?
Write a program to find factorial of a number using recursive function.
What is data structure in c and its types?
What is malloc and calloc?
What is the difference between int main and void main?
What is keyword with example?
Write a program which returns the first non repetitive character in the string?
Do you know what are bitwise shift operators in c programming?