Code to print single line in c :
#include <stdio.h>Output :
int main(void)
{
printf("Hello World!\n");
}
Hello World!Code to print multiple lines in C :
• Output :
#include <stdio.h>
int main(void)
{
printf("Some say the world will end in fire,\n");
printf("Some say in ice.\n");
printf("From what I’ve tasted of desire\n");
printf("I hold with those who favor fire.\n");
printf("But if it had to perish twice,\n");
printf("I think I know enough of hate\n");
printf("To say that for destruction ice is also great\n");
printf("And would suffice.\n");
}
• Output :
Some say the world will end in fire,
Some say in ice.
From what I’ve tasted of desire
I hold with those who favor fire.
But if it had to perish twice,
I think I know enough of hate
To say that for destruction ice is also great
And would suffice.Code to take integer input in C :
#include <stdio.h>Output :
int main(void)
{
int number;
printf("Enter a number:");
scanf("%d",&number);
printf("\n");
printf("Number you entered : %d\n",number);
return 0;
}
Enter a number: 16
Number you entered : 16