Saturday, December 5, 2015

Basic in c programming.

Basic in c programming. 

1 st I write a program after analysis the code, that witch code how work ?

Sum between 2 number.

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

Analysis:

#include<stdio.h>  is header file. stdio.h for basic input output.
int main()    this is main function and you have to write code in the "{}".
int for integer data type.
a.b.sum is veriable.
printf() for output.
scanf() for input.
getch() for program window stay till you close the window.

Hope it will help you.

No comments:

Post a Comment