How to write a c programming - 6 Players blogs for technology

give us your feedback

People Online

Breaking

ads

Post Top Ad

Wednesday, May 15, 2019

How to write a c programming

hello dear friend welcome to our website


just follow the step ..........
step 1
this is a dynamic way you there is two way writing a program  and these way are:-
1. Dynamic is a way that a allow a user to enter the number after completing writing the program  while statics
2. Static is build in program user already write his number inside the program that means a user is just waiting to see his answer.

example
1. for dynamic program


#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a,b,c;
    printf("\n\t enter the first number = ");
    scanf("%d",&a);
     printf("\n\t enter the second number = ");
    scanf("%d",&b);
    c=a+b;
    printf("\n\t the answer is %d",c);
    return 0;
}

output after running
enter the first number = 2
enter the second number = 2
the answer is 4


2. for statics

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a=2,b=2,c;
    c=a+b;
    printf("\n\t the answer is %d",c);
    return 0;
}
output after running

the answer is 4


I think the d/f is clear 

1 comment:

ads1

Post Top Ad