Webhosting in Pakistan
Results 1 to 8 of 8

Thread: Plz Help Me....

  1. #1
    ali134 is offline Senior Member+
    Last Online
    29th September 2018 @ 11:02 AM
    Join Date
    20 Oct 2015
    Age
    21
    Gender
    Male
    Posts
    31
    Threads
    13
    Credits
    167
    Thanked
    0

    Default Plz Help Me....

    Webhosting in Pakistan
    Ye 1 program ka solve kr do.. C
    Write a programe to Find Ascii value of a Character please help me

  2. #2
    AsifSattarvi's Avatar
    AsifSattarvi is offline Senior Member+
    Last Online
    2nd April 2017 @ 01:46 PM
    Join Date
    20 May 2012
    Gender
    Male
    Posts
    6,593
    Threads
    104
    Credits
    23,053
    Thanked
    957

    Default

    Program to Print ASCII Value
    ------------
    #include <stdio.h>
    int main()
    {
    char c;
    printf("Enter a character: ");

    // Reads character input from the user
    scanf("%c", &c);

    // %d displays the integer value of a character
    // %c displays the actual character
    printf("ASCII value of %c = %d", c, c);
    return 0;
    }

  3. #3
    AsifSattarvi's Avatar
    AsifSattarvi is offline Senior Member+
    Last Online
    2nd April 2017 @ 01:46 PM
    Join Date
    20 May 2012
    Gender
    Male
    Posts
    6,593
    Threads
    104
    Credits
    23,053
    Thanked
    957

    Default

    Output
    ---------
    Enter a character: G
    ASCII value of G = 71

    In this program, user is asked to enter a character which is stored in variable c. The ASCII value of that character is stored in variable c rather than that variable itself.
    When %d format string is used, 71 (ASCII value of 'G') is displayed.
    When %c format string is used, 'G' itself is displayed.

  4. #4
    Motri's Avatar
    Motri is offline Advance Member
    Last Online
    21st August 2018 @ 11:48 AM
    Join Date
    14 Oct 2013
    Location
    Sargodha
    Age
    21
    Gender
    Male
    Posts
    761
    Threads
    66
    Credits
    1,445
    Thanked
    57

    Default

    #include<stdio.h>
    main()
    { int i;
    for(i=1;i<257;i++)
    printf("%d %c",i,i);
    }
    Evil+angel=world

  5. #5
    AsifSattarvi's Avatar
    AsifSattarvi is offline Senior Member+
    Last Online
    2nd April 2017 @ 01:46 PM
    Join Date
    20 May 2012
    Gender
    Male
    Posts
    6,593
    Threads
    104
    Credits
    23,053
    Thanked
    957

    Default

    an other porgram
    C Program to find ASCII Value of a Character
    In this program, User is asked to enter any character and this program will display the ASCII value of that character.

    CODE
    /* C Program to find ASCII Value of a Character */
    #include <stdio.h>

    int main()
    {
    char ch;

    printf("\n Please Enter any character \n");
    scanf("%c",&ch);

    printf("\n The ASCII value of given character = %d",ch);
    return 0;
    }

  6. #6
    AsifSattarvi's Avatar
    AsifSattarvi is offline Senior Member+
    Last Online
    2nd April 2017 @ 01:46 PM
    Join Date
    20 May 2012
    Gender
    Male
    Posts
    6,593
    Threads
    104
    Credits
    23,053
    Thanked
    957

    Default

    C Program to find ASCII value of all Characters
    This program will print ASCII values of all the characters currently present.

    CODE
    /* C Program to find ASCII Value of a Character */
    #include <stdio.h>

    int main()
    {
    int i;

    for(i=0;i<=255;i++)
    {
    printf("The ASCII value of %c = %d\n",i,i);
    }
    return 0;
    }

  7. #7
    AsifSattarvi's Avatar
    AsifSattarvi is offline Senior Member+
    Last Online
    2nd April 2017 @ 01:46 PM
    Join Date
    20 May 2012
    Gender
    Male
    Posts
    6,593
    Threads
    104
    Credits
    23,053
    Thanked
    957

    Default

    C Program to find Sum of ASCII value in a String
    This program allows the user to enter any valid string and then, this program will display the ASCII value of each individual character present in that string and calculate the Sum of all those ASCII values.

    CODE
    #include <stdio.h>
    #include <string.h>

    void main()
    {
    int i, sum = 0, length;
    char name[50];

    printf("\nPlease Enter any name You wish\n");
    scanf("%s", name);

    while(name[i]!='\0')
    {
    printf("\nThe ASCII value of the Character %c = %d\n",
    name [i], name [i]);
    sum = sum + name [i];
    i++;
    }
    printf("\nSum of all characters : %d ", sum);
    }

  8. #8
    Join Date
    09 Apr 2009
    Location
    کر&
    Gender
    Male
    Posts
    13,528
    Threads
    222
    Credits
    9,918
    Thanked
    1463

    Default

    Webhosting in Pakistan
    ممبر کا مسلہ شاید حل ہو چکا ہے اتنا عرصہ گزرے کے بعد

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •