Examples

Small and Simple examples for new learner.
1. C programming

   [List of programs]
  1. C Program to Print a Sentence 
  2. C Program to Print a Integer Entered by a User 
  3. C Program to Add Two Integers C Program to Multiply two Floating Point Numbers 
  4. C Program to Find ASCII Value of a Character C Program to Find Quotient and Remainder of Two Integers Entered by User C Program to Find Size of int, float, double and char of Your System 
  5. C Program to Demonstrate the Working of Keyword long C Program to Swap Two Numbers 
  6. C Program to Check Whether a Number is Even or Odd C Program to Check Vowel or Consonant 
  7. C Program to Find the Largest Number Among Three Numbers C Program to Find all Roots of a Quadratic equation 
  8. C Program to Check Leap Year 
  9. C Program to Check Whether a Number is Positive or Negative or Zero. 
  10. C Program to Check Whether a Character is an Alphabet or not 
  11. C Program to Calculate Sum of Natural Numbers 
  12. C Program to Find Factorial of a Number 
  13. C Program to Generate Multiplication Table 
  14. C Program to Display Fibonacci Series 
  15. C Program to Find HCF of two Numbers 
  16. C Program to Find LCM of two Numbers 
  17. C Program to Count Number of Digits of an Integer 
  18. C Program to Reverse a Number 
  19. C Program to Calculate the Power of a Number 
  20. C Program to Check Whether a Number is Palindrome or Not 
  21. C Program to Check Whether a Number is Prime or Not 
  22. C Program to Display Prime Numbers Between Two Intervals 
  23. C Program to Check Armstrong Number 
  24. C Program to Display Armstrong Number Between Two Intervals 
  25. C Program to Display Factors of a Number 
  26. C Program to Print Pyramids and Triangles in C programming using Loops 
  27. C Program to Make a Simple Calculator to Add, Subtract, Multiply or Divide Using switch...case 
  28. C Program to Display Prime Numbers Between Intervals by Making Function
  29. C Program to Check Prime and Armstrong Number by Making Function 
  30. C Program to Check Whether a Number can be Express as Sum of Two Prime Numbers 
  31. C Program to Find Sum of Natural Numbers using Recursion. 
  32. C Program to Calculate Factorial of a Number Using Recursion 
  33. C Program to Find H.C.F Using Recursion 
  34. C Program to Reverse a Sentence Using Recusrion 
  35. C Program to Calculate the Power of a Number Using Recursion 
  36. C Program to Convert Binary Number to Decimal and Decimal to Binary 
  37. C Program to Convert Octal Number to Decimal and Decimal to Octal 
  38. C Program to Convert Binary Number to Octal and Octal to Binary 
  39. C Program to Calculate Average Using Arrays 
  40. C Program to Find Largest Element of an Array 
  41. C Program to Calculate Standard Deviation
  42. C Program to Add Two Matrix Using Multi-dimensional Arryas
  43. C Program to Multiply to Matrix Using Multi-dimensional Arrays 
  44. C Program to Find Transpose of a Matrix 
  45. C Program to Multiply two Matrices by Passing Matrix to Function 
  46. C Program to Sort Elements of an Array 
  47. C Program to Access Elements of an Array Using Pointer 
  48. C Program Swap Numbers in Cyclic Order Using Call by Reference 
  49. C Program to Find Largest Number Using Dynamic Memory Allocation 
  50. C Program to Find the Frequency of Characters in a String 
  51. C Program to Find the Number of Vowels, Consonants, Digits and White space in a String 
  52. C Program to Remove all Characters in a String Except Alphabet 
  53. C Program to Reverse a String by Passing it to Function 
  54. C Program to Find the Length of a String 
  55. C Program to Concatenate Two Strings 
  56. C Program to Copy a String 
  57. C Program to Sort Elements in Lexicographical Order (Dictionary Order) 
  58. C Program to Change Decimal to Hexadecimal Number and Vice Versa 
  59. C Program to Convert Hexadecimal to Octal and Vice Versa 
  60. C Program to Convert Binary Number to Hexadecimal Vice Versa 
  61. C Program to Store Information(name, roll and marks) of a Student Using Structure 
  62. C Program to Add Two Distances (in inch-feet) System Using Structures
  63. C Program to Add Two Complex Numbers by Passing Structure to a Function 
  64. C Program to Calculate Difference Between Two Time Period
  65. C Program to Store Information of 10 Students Using Structure 
  66. C Program to Store Information Using Structures for n Elements Dynamically 
  67. C Program to Write to a Sentence to a File
  68. C Program to Read a String of Text from File 
[PROGRAMS]


C Program To display the triangle using *, numbers and character

Write a C Program to print half pyramid as using * as shown in figure below.
*
*   *
*   *   *
*   *   *   *
*   *   *   *   *

Answer:
----------------------------------------------------------------
#include <stdio.h>
 int main() { 
int i,j,rows;
printf("Enter the number of rows: ");
scanf("%d",&rows);
 for(i=1;i<=rows;++i) {
  for(j=1;j<=i;++j) {
      printf("* "); 
   } 
   printf("\n"); 
  }
  return 0;
}
----------------------------------------------------------------


2. C++ programming

3. Java programming

4. PHP programming

5. Pearl programing
read more...

0 comments : on " Examples "

Post a Comment

Popular Posts