progrem to generate the following series
1
12
123
1234
12345
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
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 |
Write a program to print the prime numbers from 1 to 100?
Do you know the purpose of 'register' keyword?
How to write a C program to determine the smallest among three nos using conditional operator?
Write a c program to print the sizes and ranges of different data types in c?
what are advantages of U D F?
program to find the second largest word in a paragraph amongst all words that repeat more thn twice
Prove or disprove P!=NP.
Explain void pointer?
What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }
How do you write a program which produces its own source code as its output?
print ur name without using any semicolon in c/c++....
21 Answers Bosch, TCS, Wipro,
44.what is the difference between strcpy() and memcpy() function? 45.what is output of the following statetment? 46.Printf(“%x”, -1<<4); ? 47.will the program compile? int i; scanf(“%d”,i); printf(“%d”,i); 48.write a string copy function routine? 49.swap two integer variables without using a third temporary variable? 50.how do you redirect stdout value from a program to a file? 51.write a program that finds the factorial of a number using recursion?