progrem to generate the following series
1
12
123
1234
12345

Answer Posted / mustafiz

#include<stdio.h>
int main()
{
int row,i;
printf("Enter row number:\n");
scanf("%d",&row);
int sum=0;
for(i=1;i<=row;i++)
{
sum = sum *10 +i;
printf("%d\n",sum);
}
return 0;
}

Is This Answer Correct ?    25 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a factorial program using C.

638


#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }

710


Explain argument and its types.

596


what is the format specifier for printing a pointer value?

609


What is #define size in c?

640






How many header files are in c?

547


What is void main ()?

605


Explain how can I right-justify a string?

618


where are auto variables stored? What are the characteristics of an auto variable?

587


Explain the difference between structs and unions in c?

572


Is Exception handling possible in c language?

1576


Explain what are compound statements?

599


Why can't I perform arithmetic on a void* pointer?

635


When should you use a type cast?

585


What is #error and use of it?

675