Adding to integers in c
For adding to integers we need two variable for storing value , In this program we are get input from user , for taking input from we need a pre-defined function, that name is scanf.
- scanf : - scanf is a pre-defined function , which is used for taking input from users. which syantax is <"%d ", &name> .
Now we writte program -----
// program --- 02 //
- #include<conio.h>
- #include<stdio.h>
- void main()
- {
- int x,y,t;
- clrscr();
- printf("Enter two integer");
- scanf("%d %d", &x,&y);
- t=x+y;
- printf("Answer is %d",t);
- getch();
- }
..Program in pic ------
Output of this program is ---
Comments
Post a Comment