Results 1 to 8 of 8

Thread: Plz Help Me....

  1. #1
    ali134 is offline Senior Member+
    Last Online
    11th July 2019 @ 11:26 AM
    Join Date
    20 Oct 2015
    Age
    27
    Gender
    Male
    Posts
    31
    Threads
    13
    Credits
    174
    Thanked
    0

    Default Plz Help Me....

    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 Advance Member
    Last Online
    12th October 2022 @ 02:54 PM
    Join Date
    20 May 2012
    Gender
    Male
    Posts
    6,594
    Threads
    104
    Credits
    30,058
    Thanked
    960

    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 Advance Member
    Last Online
    12th October 2022 @ 02:54 PM
    Join Date
    20 May 2012
    Gender
    Male
    Posts
    6,594
    Threads
    104
    Credits
    30,058
    Thanked
    960

    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
    16th January 2024 @ 01:27 PM
    Join Date
    14 Oct 2013
    Location
    Sargodha
    Age
    27
    Gender
    Male
    Posts
    770
    Threads
    67
    Credits
    1,924
    Thanked
    58

    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 Advance Member
    Last Online
    12th October 2022 @ 02:54 PM
    Join Date
    20 May 2012
    Gender
    Male
    Posts
    6,594
    Threads
    104
    Credits
    30,058
    Thanked
    960

    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 Advance Member
    Last Online
    12th October 2022 @ 02:54 PM
    Join Date
    20 May 2012
    Gender
    Male
    Posts
    6,594
    Threads
    104
    Credits
    30,058
    Thanked
    960

    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 Advance Member
    Last Online
    12th October 2022 @ 02:54 PM
    Join Date
    20 May 2012
    Gender
    Male
    Posts
    6,594
    Threads
    104
    Credits
    30,058
    Thanked
    960

    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
    KARACHI&
    Gender
    Male
    Posts
    19,274
    Threads
    411
    Credits
    39,651
    Thanked
    1813

    Default

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

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
  •