## INDEX

### Write a c program for Floyd’s triangle.

1. Write a c program to print Floyd’s triangle

2. C program to display Floyd’s triangle

3. How to print Floyd’s triangle in c

#include<stdio.h>

int main(){

int i,j,r,k=1;

printf("Enter the range: ");
scanf("%d",&r);

printf("FLOYD'S TRIANGLE\n\n");
for(i=1;i<=r;i++){
for(j=1;j<=i;j++,k++)
printf(" %d",k);
printf("\n");
}

return 0;
}

Sample output:
Enter the range: 10
FLOYD'S TRIANGLE

1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31 32 33 34 35 36
37 38 39 40 41 42 43 44 45
46 47 48 49 50 51 52 53 54 55

What is Floyd’s triangle?

Definition of floyd's triangle:

Floyd's triangle is a right angled-triangle using the natural numbers. Examples of floyd's triangle:

Example 1:

1
2 3
4 5 6
7 8 9 10

Example 2:

1
2   3
4   5   6
7   8   9   10
11  12  13  14  15
16  17  18  19  20 21

10. Write a c program to add two numbers without using addition operator.
11. Write a c program to subtract two numbers without using subtraction operator.
15. Write a c program to solve quadratic equation.
18. Write a c program which passes structure to function.
28. Write a c program which takes password from user.
29. Write a scanf function in c which accept sentence from user.
30. Write a scanf function in c which accept paragraph from user.

1. poda dai

1. enna pa thambi....onnu puriyalaya...????

2. Write a C program to generate the below pattern of letters:
A B C D E F F E D C B A
A B C D E E D C B A
A B C D D C B A
A B C C B A
A B B A
A A

1. int main()
{
char *c="ABCDEF";
char *c1="FEDCBA";
int i,j=0;
for(i=6;i>0;i--)
{
printf("%*.*s",i,i,c);
printf("%*.*s\n",i,i,c1+j);
j++;
}
getch();
}
by Prem baboo

2. thanks rahul

3. 4
4 3 4
4 3 2 3 4
4 3 2 1 2 3 4
4 3 2 3 4
4 3 4
4

plz send this diagram coding

4. wot i do to make my programming strong

5. thanku very much

6. 1
2 6
120 240 720

7. * *
** **
*** ***
*******

pls send the diagram coding

8. hai,i want this code,could you send me

9. can you send me this program?

10. best website to learn c programming and c graphics. Just visit www.programmingcampus.com

11. what happens if return 0 is not there

12. ABCDCBA
ABC CBA
AB BA
A A

13. how to print
54321
5432
543
54
5

1. #include
int main()
{
int r,i,j,m;
printf("Enter any number:\n");
scanf("%d",&r);
m=r;
for(i=1; i<=n; i++)
{
for(j=m; j>=i; j--,m--)
{
printf("%d\t",m);
}
m=r;
printf("\n");
}
return 0;
}

14. how to print
55555
4444
333
22
1

1. #include
#include
main()
{
int n,i,j,m;
clrscr();

printf("\n\nEnter any number=>");
scanf("%d",&n);
m=n;

for(i=1; i<=n; i++)
{
for(j=m; j>=1; j--)
{
printf("\t%d",m);
}
m--;
printf("\n");
}

getch();
return 0;
}

15. i want the code for construct the structure of "A" with the help of *

16. 1
2 3
4 5 6
7 8 9 10 in c++

1. int i,j=0,p=1;
for(i=1;i<=10;i++)
{
printf("%d",i);
if(i==p)
{
printf("\n");
p++;
j++;
p=p+j;
}
}

17. 1
2 5
3 6 8
4 7 9 10
Can some1 write program for this?

18. int main(){

int i,j,r,k=1;

printf("Enter the range: ");
scanf("%d",&r);

printf("FLOYD'S TRIANGLE\n\n");
for(i=1;i<=r;i++){
for(j=1;j<=i;j++,k++)
{
printf(" %d",k);
printf("\t")

}
printf("\n");
}

return 0;
}

19. 0
1 0 1
2 1 0 1 2
3 2 1 0 1 2 3
4 3 2 1 0 1 2 3 4

20. give the c programme for *
* *
* * *
* * * *

21. This comment has been removed by the author.

22. plz someone give me the c program for
1
2 3
4 5 6
7 8 9 10

23. Case1
Initialise tsales as 0
Float minimunsales,incentive_amount,avg_sales=0
Loop 0 to n
Read salespersonid and his sales
tsales+=salesperson[index][1]
minimunsales =( avg_sales *2)/(float)3;
Write Salesperson ID Incentive Amount
loop index=0 to 10

if(salesperson[index][1]> minimunsales)

incentive_amount=(float)(salesperson[index][1]- minimunsales)*(float)0.2;
write salesperson[index][0],incentiveamount

End if

24. 1
2 5
3 6 8
4 7 9 10
Plzzz send this daigram....!

25. how to print ......

AAAAAAAAAAA
AABBBBBBBAA
ABABBBBBABA
ABBABBBABBA
ABBBABABBBA
ABBBBABBBBA
ABBBABABBBA
ABBABBBABBA
ABABBBBBABA
AABBBBBBBAA
AAAAAAAAAAA

1. #include
#include
void main()
{
int i,j,k,n;
clrscr();
printf("\nEnter the Number to increase length= ");
scanf("%d",&n);

for(i=1;i<n;i++)
{
printf("A");
}
printf("\n");
for(i=1;i<n;i++)
{
for(j=1;j<n;j++)
{
if(i==j||i==j*i||j==(n-i)||j==n-1)
{
printf("A");
}
else
{
printf("B");
}

}
printf("\n");
}
for(i=1;i<n;i++)
{
printf("A");
}
getch();
}

Enter a number: 5
Output:
1
2 3 2
3 4 5 4 3
4 5 6 7 6 5 4
5 6 7 8 9 8 7 6 5

27. 1
2 3
4 5 6
7 8 9 10
11 12 13 14 15

1. This comment has been removed by the author.

28. 1
121
12321
1234321

1. #include
void main()
{
int i,j,k=1,l;
for(i=1;i<=4;i++)
{
l=i;
for (j=1;j<=k ;j++ )
{
if(j>=i+1)
printf("%d",--l);
else
printf("%d",j);
}
k=k+2;
printf(" ");
}
}

Any Problem contact to niteshsrivatva@gmail.com

29. 5 = 1 + 1 + 1 + 1 +1
5 = 1 + 1 + 1 + 2
5 = 1 + 1 + 3
5 = 1 + 4
5 = 2 + 1 + 1 + 1
5 = 2 + 1 + 2
5 = 2 + 3
5 = 3 + 1 + 1
5 = 3 + 2
5 = 4 + 1
how i can do it using looping statement

30. *****
*****
*****
*****
*****
*****
*****
*****
*****

1. *****
*****
*****
*****
*****
*****
*****
*****
*****
need help.. :(

31. 1
01
101
0101

1. ublic class Simple {

public static void main(String[] args) {

int i,j,rem;

for( i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
rem=j%2;
System.out.println(" "+rem);
}
System.out.println();
}

}
}

32. 1 2 3 4 5
2 3 4 5
3 4 5
4 5
5
help me!

33. what will be code for this pattern
===>1
==>3 5
=>7 9 11

34. 1
3 2
4 5 6
10 9 8 7

1
01
101
0101
10101

36. send me the source code for this problem
*
**
***
****
*****

and
*
**
***
****
*****
sinthulanpathman@gmail.com

37. Thanks for nice post.C programming details here

38. if a input the 1 from keyboard output should be A and if i input the 2 output is should be AB
Same ting if 26 inputed output is to be ABCDEF.......Z

39. *
**
***
****
*****
****
***
**
*

40. how to print

*X*X*
X*X*X
*X*X*
X*X*X
*X*X*

41. This comment has been removed by the author.

42. program for
A
BC
DEF
1 GHIJ

43. How to print
23 21 24 19 26 15 28 11 30 7 36

44. program for

1 2 3 4 5
16 17 18 19 6
15 24 25 20 7
14 23 22 21 8
13 12 11 10 9

help me plz

45. 1 2 3 4 5
16 17 18 19 6
15 24 25 20 7
14 23 22 21 8
13 12 11 10 9

46. 01 02 03 04 05
16 17 18 19 06
15 24 25 20 07
14 23 22 21 08
13 12 11 10 09

47. 1
3 5
7 9 11
13 15 17 19

50. Hello Friends,
write a program to print the series:
1) 23 21 24 19 26 15 28 11 30 7 36
Logic:
23-2=21
21 3=24
24-5=19
19 7=26
26-11=15
15 13=28
28-17=11
11 19=30
30-23=7
7 29=36
2 3 5 7 11 13 17 19 23 29 31 are prime numbers.

2) 15 29 56 108 208 400
Logic:
2*15-1=29
2*29-2=56
2*56-4=108
2*108-8=208
2*208-16=400

3) 21 32 54 87 131 186
Logic:
21 11*1=32
32 11*2=54
54 11*3=87
87 11*4=131
131 11*5=186

51. guys help,i want this code in c.
1
2*3
4*5*6
4*5*6
2*3
1
if n=3 we have to print this three lines....

52. help me for
11 12 13 14 15
7 8 9 10
4 5 6
2 3
1

53. 1
12
123
1234
12345
1234
123
12
1

Plz share the program for above sequence

54. Guys Please Solve..........................
Output:
Enter a Number = 5
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5

55. how to print this using c
1
2 6
3 7 10
4 8 11 13
5 9 12 14 15

56. please someone help me to print this using c:
01
** 03
** ** 06
** ** ** 10
** ** ** ** 15
** ** ** ** ** 21
** ** ** ** ** ** 28
Thanks

57. please someone help me to print this using c:
01
** 03
** ** 06
** ** ** 10
** ** ** ** 15
** ** ** ** ** 21
** ** ** ** ** ** 28
Thanks

58. I need answer for this question either in C or Java?
7
14 15
28 29 30 31
56 57 58 59 60 61 62 63

59. Nice post. Check list of Java programming interview questions at http://modernpathshala.com/Learn/Java/Assessment