You can choose from puts, fputs, fwrite, write (or even putchar, putc, fputc). I hope this will help you to start.
main() { if(printf("%c",59)) }
printf("1 3 5 7 9\n");
#include<stdio.h> #include<conio.h> void main() { clrscr(); printf("Your name here"); getch(); }
Yes,we can compile our program without header file without any error,but we can not use any predefine functions like printf,scanf.
for (int i=1; i<20; i+=2) printf ("%d\n", i);
#include <stdio.h> void main() { int a,b,c,i,j; printf("Enter the number of rows for square matrix : "); scanf("%d",&a); for(i=1;i<=a;i++) { for(c=1,j=1;j<=a;j++,c++) { if(c==i) printf("1 "); else printf("0 "); } printf("\n"); } getch(); }
// Define and initialize input buffer char inputBuffer[256]; memset(inputBuffer, '\0', 256); // Get input scanf("%s", inputBuffer); // Display exactly what the user typed in printf("%s\n", inputBuffer);
printf ("The White House\n1600 Pennsylvania Avenue NW\nWashington, DC 20500\n");
#include#includevoid main(){char ch;clrscr();printf("enter to know ascii value");scanf("%c",&ch);printf("%d",ch);getch();}
#include<stdio.h> main() { int i,n; clrscr(); printf("enter the value"); scanf("%d", &n); while(i<=10) { printf("\n %d*%d=%d",n,i,(i*n)); i++; } getch(); }
#include<stdio.h> #include<conio.h> void main() { int i, a[100]; clrscr(); printf("Numbers from 1 to 100"); for(i=1;i<=100;i++) printf(" %d",a[i]); printf("Numbers from 1 to 100 without multiples of 2"); for(i=1;i<=100;i++) { if (a[i]%2 !=0) printf(" %d",a[i]); } printf("Numbers from 1 to 100 without multiples of 3"); for(i=1;i<=100;i++) { if (a[i]%3 !=0) printf(" %d",a[i]); } printf("Numbers from 1 to 100 without multiples of 4"); for(i=1;i<=100;i++) { if (a[i]%4 !=0) printf(" %d",a[i]); } printf("Numbers from 1 to 100 without multiples of 5"); for(i=1;i<=100;i++) { if (a[i]%5 !=0) printf(" %d",a[i]); } printf("Numbers from 1 to 100 without multiples of 6"); for(i=1;i<=100;i++) { if (a[i]%6 !=0) printf(" %d",a[i]); } printf("Numbers from 1 to 100 without multiples of 7"); for(i=1;i<=100;i++) { if (a[i]%7 !=0) printf(" %d",a[i]); } printf("Numbers from 1 to 100 without multiples of 8"); for(i=1;i<=100;i++) { if (a[i]%8 !=0) printf(" %d",a[i]); } printf("Numbers from 1 to 100 without multiples of 9"); for(i=1;i<=100;i++) { if (a[i]%9 !=0) printf(" %d",a[i]); } getch(); }
/* write a program to print Days of Week using switch-case structure */ #include<stdio.h> #include<conio.h> void main() { int n; clrscr(); printf("\n Enter Day of weak as Number 1 to 7 "); scanf("%d",&n); switch(n) { case 1: printf("\n MONDAY "); case 2: printf("\n TUESDAY"); case 3: printf("\n WEDNESDAY"); case 4: printf("\n THURSDAY"); case 5: printf("\n FRIDAY"); case 6: printf("\n SATURDAY"); case 7: printf("\n SUNDAY"); default : printf("\n no operation is required"); } getch(); }