Output string, int and float type variable with printf() - C Language Basics

C examples for Language Basics:printf

Description

Output string, int and float type variable with printf()

Demo Code

#include <stdio.h>
int main()//from   w ww  .j a  v a 2 s .c  om
{
   char menuitem[] = "Slimy Orange Stuff \"Icky Woka Gu\"";
   int pints=1;
   float price = 1.45;
   printf("Today special - %s\n",menuitem);
   printf("You want %d pint.\n",pints);
   printf("That be $%f, please.\n",price);
   return(0);
}

Result


Related Tutorials