1. use the help/manual
2. entirely different: put one character vs put string with formatted inserts
you can put the printf function inside a if() so that you need not use semicolons. for eg to print my name, if(printf("My Name is Maheedharan")) {} this will work. try this out...
Printf is a function which can output a "string literal," which means that unlike its similiar, putchar, it can in fact print entire sentences, including formatted data. Also, it's defined in stdio.h.
putchar ('%'); puts ("%"); printf ("%%"); etc...
You can choose from puts, fputs, fwrite, write (or even putchar, putc, fputc). I hope this will help you to start.
int main() { // Call the printf function printf("This is a function call!\n"); return 0; }
input scanf() , getch() , getche() output printf() , putch() , putchar()
Any of the following are snippets of code providing some ways of doing it: printf("1 2 3 4 5 6"); write(0, "1 2 3 4 5 6", 11); puts("1 2 3 4 5 6"); for (i = 0; i++ < 5; printf("%d ", i); printf("%d", i); for (i = 0; ++i < 6; putchar(' ')) putchar('0' + i); putchar('0' + i);
write, putchar, putc, fputc etc
== == What is printf in c or prototype of printf with example (q) What is prototype of printf function ? Explain each term. Ans: Prototype of printf function is : int printf( const char *format ,…) Explanation of each term : Parameter of printf function is : (three continuous dots) : It is called ellipsis. It indicates the variable number of arguments. Example of ellipsis: #include void ellipsis(int a,...); void main() { int a=5,b=10; clrscr(); ellipsis(a,b); getch(); } void ellipsis(int a,...) { printf("%d ",a); } Output:5 So printf function can have any number of variables as an argument.
Yes. However, C is a type-sensitive language thus PRINTF and printf would need to be defined as separate functions. However, names using all caps are conventionally used to denote macros in C thus you can easily define PRINTF as an alias for printf: #define PRINTF printf; int main (void) { PRINTF ("%d", 42); } The C precompiler will substitute all instances of the symbol PRINTF with printf, thus the code seen by the compiler will become: int main (void) { printf ("%d", 42); }
printf , scanf , getchar, putchar, getc are the other operators in C except gets and puts..
Printf function is used in c language. Printf is used to print something to the standard output. ex: printf ('welcome');