C Program To Add Two Numbers Using Functions Code Example


Example 1: c program to add two numbers

#include <stdio.h> int main() {          int number1, number2, sum;          printf("Enter two integers: ");     scanf("%d %d", &number1, &number2);      // calculating sum     sum = number1 + number2;                printf("%d + %d = %d", number1, number2, sum);     return 0; }

Example 2: add 2 numbers in c

#include<stdio.h> int main() { int a, b, sum; printf("\nEnter two no: "); scanf("%d %d", &a, &b); sum = a + b; printf("Sum : %d", sum); return(0);

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable