You can use fputs() instead of printf().
If you forget the semicolon, your program won't compile.
#include<stdio.h> int main (void) { printf ("Hello world!\n"); return 0; }
write, putchar, putc, fputc etc
its quite simple using printf function
I believe, you can use C-function - printf().
printf("%c[%d;%dmHello World%c[%dm\n",27,1,33,27,0);
Arranging 10 numbers in descending orders using C programming language and finding one of them using binary search method is as below: #include void main () { int i,j,a,n,number[30]; printf ("Enter the value of Nn"); scanf ("%d", &n); printf ("Enter the numbers n"); for (i=0; i
#include<stdio.h> #include<conio.h> int main() { int i=0,opt; printf("Enter your choice\n"); printf("1. Horizontal line"); printf("\n2. Vertical line\n"); scanf("%d",&opt); if(opt==1) { for(i=0;i<=50;i++) printf("%c",196); } else { for(i=0;i<=40;i++) printf("%c\n",179); } return 0; }
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); }
while (2*2==4) printf ("Still running\n");
Here is an example:#include int main (void){puts ("Hello, world");return 0;}
use cout << simple