It is a function.
if (a > b && a > c) printf("%d\n", a); else if (b > c) printf("%d\n", b); else printf("%d\n", c);
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.
I believe, you can use C-function - printf().
// HI THIS IS MAYANK PATEL /*C Program to find Maximum of 3 nos. using Nested if*/ #include<stdio.h> #include<conio.h> void main() { int a,b,c; // clrscr(); printf("Enter three number\n\n"); scanf("d%d",&a,&b,&c); if(a>b) { if(a>c) { printf("\n a is maximum"); } else { printf("\n c is maximum"); } } else { if(b>c) { printf("\n b is maximum"); } else { printf("\n c is maximum"); } } getch(); }
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); }
if (a > b && a > c) printf("%d\n", a); else if (b > c) printf("%d\n", b); else printf("%d\n", c);
try to usecondition ? value if true : value if falseor: if (printf ("Hello")) {}
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.
Yes, it is int.
I believe, you can use C-function - printf().
void main() { int a,b,c; clrscr(); printf("Enter the value of a:"); scanf("%d",&a); printf("\nEnter the value of b:"); scanf("%d",&b); printf("\nEnter the value of c:"); scanf("%d",&c); if(a>b) { if(a>c) { if(b>c) { printf("c is smallest\n"); printf("b is middle\n"); printf("a is largest\n"); } else { printf("b is smallest\n"); printf("c is middle\n"); printf("a is largest\n"); } } else { printf("b is smallest\n"); printf("a is middle\n"); printf("c is largest\n"); } } else if(b>c) { if(a>c) { printf("c is smallest\n"); printf("a is middle\n"); printf("b is largest\n"); } else { printf("a is smallest\n"); printf("c is middle\n"); printf("b is largest\n"); } } else { printf("a is smallest\n"); printf("b is middle\n"); printf("c is largest\n"); } getch(); }
int main (void) { if(printf("Print whatever you want")) { } }
it's not a statement, it's a function: len= printf (format, ...more-parameters...);
I don't really get your point, it is unlikely that both then-statement and else-statement should be executed. I daresay it is impossible.Try me:printf ("before if\n");if (1) printf ("condition is true (non zero)\n");else printf ("condition is false (zero)\n");printf ("after if\n");
int f(int num) { int i; for (i = 0; i < 10; i++) { if (num > i) continue; printf("aaa"); } } printf will only be reached when i <= num.
#include <limits.h> if (1) { printf ("INT_MAX is %d\n", INT_MAX); printf ("LONG_MAX is %ld\n", LONG_MAX); }
// HI THIS IS MAYANK PATEL /*C Program to find Maximum of 3 nos. using Nested if*/ #include<stdio.h> #include<conio.h> void main() { int a,b,c; // clrscr(); printf("Enter three number\n\n"); scanf("d%d",&a,&b,&c); if(a>b) { if(a>c) { printf("\n a is maximum"); } else { printf("\n c is maximum"); } } else { if(b>c) { printf("\n b is maximum"); } else { printf("\n c is maximum"); } } getch(); }