Find sum of Two Integer Numbers : C Program

Computer Science » C Program » Find sum of Two Integer Numbers

Program :

#include<stdio.h>
 
int main()
{
   int a, b, sum;
 
   printf("Enter the two numbers : ");
   scanf("%d %d", &a, &b);
 
   sum = a + b;
 
   printf("nSum of %d and %d is : %d", a,b,sum);
 
   return(0);
}

Output :

Enter the two numbers : 
2
4
Sum of 2 and 4 is : 6
Subject Name : Computer Science
Exam Name : IIT GATE, UPSC ESE, RRB, SSC, DMRC, NMRC, BSNL, DRDO, ISRO, BARC, NIELIT
Posts Name : Assistant Engineer, Management Trainee, Junior Engineer, Technical Assistant
Computer Science Books

GATE 2023 Total InfoENGG DIPLOMAUGC NET Total Info
IES 2023 Total InfoPSUs 2022 Total InfoCSIR UGC NET Total Info
JAM 2023 Total InfoM TECH 2023 Total InfoRAILWAY 2022 Total Info

Related Posts

  • Find Sum of Two Float Numbers : C ProgramComputer Science » C Program » Find Sum of Two Float Numbers Program : [php]#include<stdio.h> int main() { float a, b, sum; printf("Enter two numbers : "); scanf("%f %f", &a, &b); sum = a + b; printf("nSum : %.2f", sum); return(0); }[/php] Output : [php]Enter two numbers : 2.2 3.6 Sum : 5.80[/php]
    Tags: program, find, sum, numbers, computer, science, output, programs
  • C Program ExamplesComputer Science » C Program » C Program Examples "How to print hello, world! using c program ? How to find area of a circle using c program ? How to find smallest element in an array using c program ? You all must have this kind of questions in your mind. Below article will solve this puzzle of yours. Just take a look.”  - Here we have listed all the programs in C programming language, categorised under different progamming concepts like Basic, Area, Mathematical, Number, Array etc. Check the respective category to view all the programs under that category. C Programs - Basic C Programs C Programs - Number Programs C Programs - Area Programs C Programs - Mathematical Programs C Programs - Array Programs C Programs - Electrical Programs C Programs - Pyramid Programs
    Tags: programs, program, computer, science
  • Calculate Sum and Average of an Array : C ProgramComputer Science » C Program » Calculate Sum and Average of an Array Program : [php]#include <stdio.h> int main() { int Arr[50]; int n, i, sum = 0; float average; printf("Enter the number of elements in Array : "); scanf("%d", &n); for (i = 0; i < n; i++) { printf("nEnter element %d : ", i + 1); scanf("%d", &Arr[i]); sum = sum + Arr[i]; } average = (float)sum/n; printf("nThe sum of the elements array is : %d", sum); printf("nThe average of the elements array is : %0.2f", average); return 0; }[/php] Output : [php]Enter the number of elements in Array : 5 Enter element 1 : 20 Enter element 2 : 30 Enter element 3 : 40 Enter element 4 : 50 Enter element 5 : 60 The sum of the elements array is : 200 The average of the elements array is : 40.00[/php]
    Tags: program, sum, computer, science, output, programs
  • Binary Numbers Pyramid : C ProgramComputer Science » C Program » Binary Numbers Pyramid  Program : [php]#include<stdio.h> int main() { int i, j; int count = 1; for (i = 1; i <= 5; i++) { printf("n"); for (j = 1; j <= i; j++) { printf("%d", count % 2); count++; } if (i % 2 == 0) count = 1; else count = 0; } return(0); }[/php] Output : [php]1 01 101 0101 10101[/php]
    Tags: program, numbers, computer, science, output, programs
  • 1-10 Numbers in Pyramid : C ProgramComputer Science » C Program » 1-10 Numbers in Pyramid Program : [php]#include<stdio.h> int main() { int i, j; int count = 1; for (i = 0; i <= 4; i++) { printf("n"); for (j = 0; j < i; j++) { printf("%dt", count); count++; } } return(0); }[/php] Output : [php]1 2 3 4 5 6 7 8 9 10 [/php]
    Tags: program, numbers, computer, science, output, programs

LEAVE A REPLY

Please enter your comment!
Please enter your name here