Skip to main content

How To Add Two Numbers In C

 Add Two Numbers In C


#include <stdio.h>//header file
#include<conio.h>//header file
void main()//starting main
{
clrscr();//for clearing the screen
int a,b,sum=0;//declaring variable
printf("enter the value of a");//input the values
scanf("%d",&a);
printf("enter the value of b");//input the values
scanf("%d",&b);
sum=a+b;//adding the numbers
printf("the sum is %d",sum);//printing the sum
getch();
}

     


Comments

Popular posts from this blog

Difference between px,dip,dp and sp in Android

Difference between px,dip,dp and sp in Android MEANING px   -> It stands for pixel and has a same meaning to the resolution of the screen density. it corresponds to the actual pixel in the screen. dip ->Dip and dip both are one and the same thing.It stands for density independent pixel.It is dependent on physical intensity pixel of screen. sp  It stands for scaled pixel. USAGE px It is used with the images to resize the image.used to fit the image to screen and change the size of the image.

Concatenation Of String

Concatenation Of String #include<iostream.h> #include<conio.h> #include<string.h> void main() { clrscr(); string str1="programming"; string str2="hub"; string str3; int len; str3=str1; cout<<str3; str3=str1+str2; cout<<str3<<endl; len=str3.size(); cout<<len<<endl; getch(); }