Skip to content

Instantly share code, notes, and snippets.

View NitishDiwakar's full-sized avatar
🏝️
Software Developer | Writer | Nature Lover

Nitish Kumar Diwakar NitishDiwakar

🏝️
Software Developer | Writer | Nature Lover
View GitHub Profile
@NitishDiwakar
NitishDiwakar / calculator.cpp
Created May 28, 2017 07:26
A command line calculator in C++
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
//-------defining variables and initializing them-------------
double num1, num2;
char operation, redo;
@NitishDiwakar
NitishDiwakar / add.c
Created May 28, 2017 07:09
Addition in C
#include<stdio.h>
int main()
{
// declare three variables.
int a = 0, b = 0, sum = 0;
printf("Please enter a number: \n" );
// read first variable
scanf("%d", &a);
printf("Please enter second number: \n" );
// read second variable
@NitishDiwakar
NitishDiwakar / hello.c
Created May 28, 2017 06:56
Hello World! in C
#include <stdio.h>
int main()
{
printf("Hello World!\n");
return 0;
}