Write a program to adding two numbers in C

                                                             

Write a program to adding two numbers in C

Code Written in Dev C++;

#include<stdio.h>

#include<conio.h>

int main()

{

int a,b,c;

printf("\n Enter First no.:- ");

scanf("%d",&a);

printf("\n Enter Second no.:- ");

scanf("%d",&b);

c = a + b;

printf("\n Sum of the entered no. is %d",c);

return 0;

}


Code Written in Turbo C++ :-

#include<stdio.h>

#include<conio.h>

void main()

{

int a,b,c;

        clrscr();

printf("\n Enter First no.:- ");

scanf("%d",&a);

printf("\n Enter Second no.:- ");

scanf("%d",&b);

c = a + b;

printf("\n Sum of the entered no. is %d",c);

getch();

}


About above uses statement and functions:-

\n :- This is known as new line character it is used to break the line.

Post a Comment

0 Comments