Write a C program to add two numbers with using a third variable?
#include <stdio.h>
#include <conio.h> main() { int a,b,c; /* Declaration */ clrscr(); printf"(Enter the value for a: "); scanf("%d",&a); /* Accepting values */ printf("Enter the value for b: "); scanf("%d",&b); /* Accepting values */ c=a+b: /* c is the third variable and calculation */ printf("After Addition: %d",c); /* displaying */ getch(); } Output: Enter the value for a: 10 Enter the value for b: 20 After Addition: 30 Write a C program to add two numbers with using a third variable?
#include <stdio.h>
#include <conio.h> main() { int a,b,c; /* Declaration */ clrscr(); printf("Enter the values for a and b: "); scanf("%d %d",&a, &b) /* Accepting values */ c=a+b: /* c is the third variable and calculate*/ printf("After Addition: %d",c); /* displaying */ getch(); } Output: Enter the value for a: 10 Enter the value for b: 20 After Addition: 30 Write a C program to add two numbers without using a third variable?
#include <stdio.h>
#include <conio.h> main() { int a,b; /* Declaration */ clrscr(); printf("Enter the value for a: "); scanf("%d",&a); /* Accepting values */ printf("Enter the value for b: "); scanf("%d",&b) /* Accepting values */ printf("After Addition: %d",a+b); /* displaying */ getch(); } Output: Enter the value for a: 10 Enter the value for b: 20 After Addition: 30 Write a C program to add numbers without using a third variable?
#include <stdio.h>
#include <conio.h> main() { int a,b; /* Declaration */ clrscr(); printf("Enter the values for a and b: "); scanf("%d %d",&a, &b) /* Accepting values */ printf("After Addition: %d", a+b); /* displaying */ getch(); } Output: Enter the value for a: 10 Enter the value for b: 20 After Addition: 30 Try the following programs
1. Write a C program to Subtract two numbers with using a third variable? 2. Write a C program to Subtract two numbers without using a third variable? 3. Write a C program to Multiply two numbers with using a third variable? 4. Write a C program to Multiply two numbers without using a third variable? 5. Write a C program to Division two numbers with using a third variable? 6. Write a C program to Division two numbers without using a third variable? |
- Home
-
C Language
- C++
- Java
-
B.C.A
- Subject Details
- COBOL
- Digital Logic Fundamentals
- Fundamental of Digital Computers
- Microprocessor and its applications
- Programming in C
- Computer Graphics
- Operating System
- Programming in C++ and Data Structures
- DBMS
- Programming in Java
- Data Communication and Networking
- Software Engineering
- Software Testing
- Web Technology
- Elective - I >
- Elective - II >
- Elective - III >
- Maths Questions >
- English
-
B.Sc
- B.Sc (Cs) Subject Details
- Computer Architecture and Organization
- Digital Electronics and Microprocessor
- Data Structure Using C++
- Microprocessor and Its Applications
- Programming in C
- Programming in C++ and Data Structures
- Programming in Java
- Visual Programming
- Operating System
- DBMS
- Software Engineering
- Data Communication and Networking
- Software Testing
- Web Technology
- Computer Networks
- OOAD
- Multimedia Systems
- M.C.A
- M.Sc (CS)
- M.Sc (IT)
- Conduct Us
- Programming Language
- Programming Logic
- Computer Terms
- Job Selection Process
- Learn English Using Tamil
- Spoken English in Tamil
- Conversational Tamil
- English
- Interview