progrem to generate the following series
1
12
123
1234
12345

Answers were Sorted based on User's Feedback



progrem to generate the following series 1 12 123 1234 12345..

Answer / srsabariselvan

int main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf("%d\t",j);
}
printf("\n");
}
return 0;
}

Is This Answer Correct ?    115 Yes 27 No

progrem to generate the following series 1 12 123 1234 12345..

Answer / shakil ahmed

#include<stdio.h>
#include<conio.h>
main()
{
int i, j;
for(i=1; i<=5; i++)
{
for(j=1; j<=i; j++)
{
printf("%d",j);
}
printf("\n");
}
}

Is This Answer Correct ?    65 Yes 16 No

progrem to generate the following series 1 12 123 1234 12345..

Answer / 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

progrem to generate the following series 1 12 123 1234 12345..

Answer / f.hnayan

#include<stdio.h>
#include<conio.h>
main()
{
int a,b;
for(a=0;a<=4;a++)
{
for(b=1;b<=(a+1);b++)
{
printf("%d\t",b);
}
printf("\n");
}

return 0;
}

Is This Answer Correct ?    11 Yes 5 No

progrem to generate the following series 1 12 123 1234 12345..

Answer / banavathvishnu

main()
{
int a;
int temp =0;
for(i=1;i<=5;i++)
{
temp = temp *10 +i;
printf("%d",temp);
}

Is This Answer Correct ?    23 Yes 19 No

progrem to generate the following series 1 12 123 1234 12345..

Answer / sachin

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,row;
clrscr();
printf("
How many rows
");
scanf("%d",&row);
for(i=1;i<=row;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
printf("
");
}
getch();
}

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More C Interview Questions

Hai why 'c' is the middle language

4 Answers  


What are type modifiers in c?

0 Answers  


Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc

0 Answers  


What do you understand by friend-functions? How are they used?

0 Answers   iNautix,


What are pointers?

0 Answers   Accenture, Tavant Technologies, Zensar,






why we use pointer in c

7 Answers   HCL, TCS,


how does a general function , that accepts an array as a parameter, "knows" the size of the array ? How should it define it parameters list ?

0 Answers  


write an interactive C program that will encode or decode a line of text.To encode a line of text,proceed as follows. 1.convert each character,including blank spaces,to its ASCII equivalent. 2.Generate a positive random integer.add this integer to the ASCII equivalent of each character.The same random integer will be used for the entire line of text. 3.Suppose that N1 represents the lowest permissible value in the ASCII code,and N2 represents the highest permissible value.If the number obtained in step 2 above(i.e.,the original ASCII equivalent plus the random integer)exceeds N2,then subtract the largest possible multiple of N2 from this number,and add the remainder to N1.Hence the encoded number will always fall between N1 and N2,and will therefore always represent some ASCII character. 4.Dislay the characters that correspond to the encoded ASCII values.  The procedure is reversed when decoding a line of text.Be certain,however,that the same random number is used in decodingas was used in encoding.

0 Answers  


What is difference between union All statement and Union?

0 Answers  


hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel

0 Answers  


Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.

0 Answers  


If we have an array of Interger values, find out a sub array which has a maximum value of the array and start and end positions of the array..The sub array must be contiguious. Take the start add to be 4000. For Ex if we have an array arr[] = {-1,-2,-5,9,4,3,-6,8,7,6,5,-3} here the sub array of max would be {8,7,6,5} coz the sum of max contiguous array is 8+7+6+5 = 26.The start and end position is 4014(8) and 4020(5).

5 Answers   Microsoft, Motorola,


Categories