Skip to main content

Posts

Showing posts with the label C Programming

C #7-Sorting of Elements in an Array

Source Code: #include <stdio.h> void main() {     int arr[30];     int i, j, num, temp;     printf("Enter the number of values to be taken in array \n");     scanf("%d", &num);     printf("Enter the elements to array\n");     for (i = 0; i < num; i++)     {         scanf("%d", &arr[i]);     } //Sorting Operation Starts     for (i = 0; i < num; i++)     {         for (j = 0; j < (num - i - 1); j++)         {             if (arr[j] > arr[j + 1])             {                 temp = arr[j];                 arr[j] = arr[j + 1];                 arr[j + 1] = temp;             ...

C #6-Concatenation of Two String without using Strcat()

Source Code: #include <stdio.h> int main() {     char a[30], b[30], i, j;     printf("Enter first string: ");     scanf("%s", a);     printf("Enter second string: ");     scanf("%s", b);     for(i = 0; a[i] != '\0'; ++i);     for(j = 0; b[j] != '\0'; ++j, ++i)     {         a[i] = b[j];     }     a[i] = '\0';     printf("After concatenation: %s", a);     return 0; } Output: D:\D INSTALL\TDM-GCC-32\Programs>Concatstr.exe Enter first string: dharani Enter second string: dharan After concatenation: dharanidharan Also see: Reversing of Number using C Program Palindrome Number or not using C Program Thanks and Regards, Tech Bird

C #5-Reversing of Number using C Program

Previous Post:         C #4-Palindrome Number or not using C Program Next Post:   C #6-Reversing String Using String Program without using String function. Reversing of given Number Using C Source code:  #include<stdio.h>  void main()  {    int n, r, rev=0;    printf("Enter the number to Reverse :");    scanf("%d", &n);    while(n)       {         r=n%10;         rev=(rev*10)+r;         n=n/10;       }    printf("Reversed number : %d", rev);  } Output:     Enter the number to Reverse: 10     Reversed number : 01 Thanks and regards, Tech Bird

C #4-Palindrome Number or not Using C Program

Previous Post:                                                                                                                                     Next Post:                   C #3-Palindrome or not String using C Program         C #5-Reversing of number using C Program. Palindrome of Number :    Palindrome of a number is defined as a number to be same as when it is read from back and fro remains to be same...then those numbers are called palindrome numbers.. Source Code:   #include<stdio.h>   void main()   {   ...

C #3-Palindrome String or not using C Program

Previous Post:                                                                                                                                       Next Post: C #2-Addition of two number with C Program                               C #4-Palindrome String or not using C Program What is palindrome? A palindrome is word or a phrase or a sequence that remains same when it is read from  backward as well forward remains same. Example: Madam, Radar, Refer, Level, .....etc.. Let's think with programming stuff's.... Source Code:   #include<stdio.h...

C #2-Addition of two number with C Programming

Previous Post:                                                                                                                                           Next Post:              C #1-A way to start with C Programming                     C #3-Palindrome or not using C Programming             Addition two numbers using C Programming.. Source Code:    #include<stdio.h>    #include<conio.h>    void main()    {      int a = 10, b = 10;     ...

C #1-A way to start with C Programming

Hi its me dharani, Again with the C Programming blog .. Yes, You might think its old already lots of blogs and code are available , but here in Tech bird you might find learn SOMETHING MORE THAN OTHERS Early and grasp new way of programming for sure. Let's Start with Hello World! C :   It is the structured programming language.  It was designed by Ken Thompson and Dennis Ritchie.  C program has 32 keywords for operation.. Easy to start. Basic Programming Language to learn before you start programming. Source Code:    #include<stdio.h>    #include<conio.h>    void main()    {        clrscr();       print ("Hello World..!");       getch();    } Output:            Hello World..! Next Post:      C #2- Addition of two numbers with C Programming Don't fo...