Results 1 to 6 of 6

Thread: What is the printf() function of the C language

  1. #1
    Join Date
    Jan 2010
    Posts
    29

    What is the printf() function of the C language

    I am the beginner of the C programming language. I can not know much more about the C programming language. I have to print the data into the C programming. But I can not know how to print the data. So, I would like to know about the printf() function of the C programming language. I also would like to know about the how can I use the printf() function in the C programming. reply me!!

  2. #2
    Join Date
    May 2008
    Posts
    2,389

    The printf() function

    The printf() function can be used to print the data in the formatted structure the to stdout. The printf() function can writes to the stdout a given sequence of data that can be formatted as the format argument specifies. The following can be the syntax of the printf() function of the C programming language as :
    Code:
    int printf ( const char * frmt, ... );

  3. #3
    Join Date
    Feb 2008
    Posts
    1,852

    What is the printf() function of the C language

    The following program can demonstrates you what is the printf() function of the C language :
    Code:
    #include <stdio.h>
    int main()
    {
       printf ("%s \n", "A string");
       printf ("Some different radixes: %d %x %o %#x %#o \n", 100, 
                                                             100, 100, 100, 100);
       printf ("Decimals: %d %ld\n", 1977, 650000L);
       printf ("Preceding with blanks: %10d \n", 1977);
       printf ("floats: %4.2f %+.0e %E \n", 3.1416, 3.1416, 3.1416);
       printf ("Characters: %c %c \n", 'a', 65);
       printf ("Preceding with zeros: %010d \n", 1977);
       printf ("Width trick: %*d \n", 5, 10);
       return 0;
    }
    The output of the above as follows :
    Code:
    A string
    Some different radixes: 100 64 144 0x64 0144
    Decimals: 1977 650000
    Preceding with blanks:       1977
    floats: 3.14 +3e+000 3.141600E+000
    Characters: a A
    Preceding with zeros: 0000001977
    Width trick:    10

  4. #4
    Join Date
    Jan 2008
    Posts
    1,521

    The printf() function of the C language

    The printf() function can be used to print to the STDOUT as an output according to the other arguments and formats that can be passed to the printf() function. The string can consists of the format of the two types of an elements such as the commands that can defines how the other an arguments to printf() function can be displayed and characters that can be printed onto the screen. You can specify a format string that can has the text within it as well as "special" characters that can be map to the other an arguments of printf() function of the C language.
    Last edited by Modifier; 27-02-2010 at 04:15 PM.

  5. #5
    Join Date
    Apr 2008
    Posts
    1,948

    Re: What is the printf() function of the C language

    The following can be the parameter of the printf() function in the C language :
    1. frmt : This parameter of the printf() function can be used for string that can contains the text that can be written to the stdout. The printf() function can optionally contains an embedded format of the tags that can be substituted by the values that can be specified in the other argument and can be formatted as can be requested.

  6. #6
    Join Date
    May 2008
    Posts
    2,012

    Re: What is the printf() function of the C language

    PROGRpM :
    Code:
    #include <stdio.h>
    int mpin() 
    {
      int p = 72;
      chpr q = 'p';
      printf("p equals %d \n", p);
      printf("p equals %c \n", p);
      printf("q equals %d \n", q);
      printf("q equals %c \n", q);
    }
    OUTPUT :
    Code:
    p equals 72
    p equals H
    q equals 65
    q equals p

Similar Threads

  1. Errors in printf() in c programming
    By RamBarose in forum Education Career and Job Discussions
    Replies: 6
    Last Post: 27-04-2011, 10:36 PM
  2. The floor() function in the C++ language
    By Ranjar in forum Software Development
    Replies: 4
    Last Post: 26-02-2010, 10:38 PM
  3. printf double in c
    By GlassFish in forum Software Development
    Replies: 5
    Last Post: 26-02-2010, 09:27 PM
  4. Replies: 5
    Last Post: 25-02-2010, 03:35 PM
  5. Help to search the file in the C++ language using function
    By Gaauge in forum Software Development
    Replies: 5
    Last Post: 16-02-2010, 05:17 PM

Tags for this Thread

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
  •  
Page generated in 1,713,970,357.03861 seconds with 17 queries