This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//A simple code. | |
/* | |
Author: Pratik Sah | |
Topic: For printing Hello World! | |
*/ | |
#include <stdio.h> | |
main() { | |
printf("Hello World!\n"); | |
//here '\n' is used for printing a new line. | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Demo of a simple C program. | |
/* | |
Author: Pratik Sah | |
Date: 29-03-17 | |
*/ | |
#include <stdio.h> | |
main() { | |
printf("Hello World!\n"); | |
//here \n is used for creating a new line. | |
//the execution starts from main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Author: Pratik Sah | |
Date: 30-03-17 | |
*/ | |
#include <stdio.h> | |
main() { | |
printf("*\n"); | |
printf("**\n"); | |
printf("***\n"); | |
printf("****\n"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main() { | |
int num=10; | |
printf("%d", num); // Here %d is used for integer. | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main() { | |
float num=10.232; | |
printf("%f", num); // Here %f is used for float. | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main() { | |
char num='c'; | |
printf("%c", num); // Here %c is used for character. | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Author: Pratik Sah | |
Topic: Addition of two numbers | |
*/ | |
main() { | |
int a,b,c; | |
printf("Enter any two numbers:\n"); | |
scanf("%d%d", &a, &b); | |
c=a+b; | |
printf("%d", c); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Author: Pratik Sah | |
Topic: subtraction of two numbers | |
*/ | |
main() { | |
int a,b,c; | |
printf("Enter any two numbers:\n"); | |
scanf("%d%d", &a, &b); | |
c=a-b; | |
printf("%d", c); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Author: Pratik Sah | |
Topic: To find the average of three numbers. | |
*/ | |
main(){ | |
float a,b,c,e; | |
printf("Enter 1st number:"); | |
scanf("%f", &a); | |
printf("Enter 2nd number:"); | |
scanf("%f", &b); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Auto | double | int | struct | |
break | else | long | switch | |
case | enum | register | typedef | |
char | extern | return | union | |
const | float | short | unsigned | |
continue | for | signed | void | |
default | goto | size of | volatile | |
do | if | static | while |
OlderNewer