printf("Your text here %d", your_data);
or maybe you want to see '%d' as output? Try one of these:
printf ("%%d");
printf ("%cd", '%');
printf ("%s", "%d");
fputs ("%d", stdout);
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...
#include<stdio.h> #include<conio.h> void main() { clrscr(); int x=0; do { printf("Kaushal"); printf("\n"); x++; }while(x<10); getch(); }
its quite simple using printf function
With functions like ecvt, fcvt, gcvt.
#include<stdio.h> Void main() { int a,b; printf("Enter a Number: "); // for print function as an out-put scanf("%d",&a); //for scan function as in input /* Here we can use print function once again as: */ a=a++; printf("%d",a); }
Your question makes no sense.
try to usecondition ? value if true : value if falseor: if (printf ("Hello")) {}
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...
#include<stdio.h> #include<conio.h> void main() { clrscr(); int x=0; do { printf("Kaushal"); printf("\n"); x++; }while(x<10); getch(); }
use cout << simple
its quite simple using printf function
With functions like ecvt, fcvt, gcvt.
#include<stdio.h> Void main() { int a,b; printf("Enter a Number: "); // for print function as an out-put scanf("%d",&a); //for scan function as in input /* Here we can use print function once again as: */ a=a++; printf("%d",a); }
write, putchar, putc, fputc etc
You can print two variables with one printf, with or without pointers: int val1= 10, val2=20, *pval2= &val2; printf ("val1=%d, val2=%d\n", val1, *pval2);
printf ("x")
within inverted commas using two backslashes consequently .. we will print the backslash. ex: printf("//n it will gives output");