int main (void)
{
if(printf("Print whatever you want"))
{
}
}
try to usecondition ? value if true : value if falseor: if (printf ("Hello")) {}
If you forget the semicolon, your program won't compile.
use cout << simple
The print with semi - colon is used to write the text one after the other, without giving the space between them whereas the print with colon is used to type the text one after the other, with giving plenty of spaces between them.
The only way i see is to use : using the right file descriptor
#include<stdio.h> #include<conio.h> void main() { if(printf("hello world")){} if(getch()){} }
printf("%u %+d %+d",200,200,-200); //will print 200 +200 -200
Answerwell if it is about the include statement only then your answer goes simple. extern "C"{int printf(const char *format,..);}int main(){printf("Hello world");}coz all the include statement does is copy the requested file at the asked location.
With functions like ecvt, fcvt, gcvt.
It is very easy. The program begins here..... /*Program to sum and print numbers without creating variables*/ #include<stdio.h> main() { clrscr(); printf("%d+%d=%d",5,2,5+2); getch(); } /*Program ends here*/ Now just by changing the numbers in the "printf" statement we can add, subtract, multiply and divide the numbers without using variables. Hence the problem is solved..........
No, the printf() statement in C can generate multiple lines of output. You can include newline characters (\n) within the string to create line breaks, allowing for formatted output across multiple lines. Additionally, you can call printf() multiple times to print different lines.
#include <stdio.h> int main (void) { puts ("the name"); return 0; }