Technology has advanced to the point where programming has become an essential part of our lives. We use software and applications for communication, entertainment, education, and work, and these are all built on programming languages.

Greatest number among any 10 numbers

 


Share:

What is Function? Write a program to demonstrate any two string function using C.

 A function is a block of statements that performs a specific taskIn c, we can divide a large program into the basic building blocks known as function. The function contains the set of programming statements enclosed by {}. A function can be called multiple times to provide reusability and modularity to the C program. In other words, we can say that the collection of functions creates a program. The function is also known as procedure or subroutine in other programming languages.



Share:

What is Array in C? Write a program to sort numbers in descending order.

 

  • An array is a collection of data items, all of the same type, accessed using a common name.
  • A one-dimensional array is like a list;  A two dimensional array is like a table;  The C language places no limits on the number of dimensions in an array, though specific implementations may.
  1.     #include <stdio.h>
  2.     void main ()
  3.     {
  4.  
  5.         int number[30];
  6.  
  7.         int i, j, a, n;
  8.         printf("Enter the value of N\n");
  9.         scanf("%d", &n);
  10.  
  11.         printf("Enter the numbers \n");
  12.         for (i = 0; i < n; ++i)
  13. 	        scanf("%d", &number[i]);
  14.  
  15.         /*  sorting begins ... */
  16.  
  17.         for (i = 0; i < n; ++i) 
  18.         {
  19.             for (j = i + 1; j < n; ++j) 
  20.             {
  21.                 if (number[i] < number[j]) 
  22.                 {
  23.                     a = number[i];
  24.                     number[i] = number[j];
  25.                     number[j] = a;
  26.                 }
  27.             }
  28.         }
  29.  

 

Share:

Difference on Break and Continue Statement in C

 














Share:

Translate

Wikipedia

Search results