Program to find factorial of any number in C-language
Get link
Facebook
X
Pinterest
Email
Other Apps
-
#include<stdio.h>
int main()
{
int x,f=1,i;
printf("Enter the number\n");
scanf("%d",&x);
for(i=1;i<=x;i++)
{
f=f*i;
}
printf("Factorial of %d is=%d",x,f);
}
2. Language Translator 1. Assembler 2. Compiler 3. Interpreter 4. Linker 5. Loader 1.Assembler:- In computer science, assembler is a program which convert assembly level language into machine level language, because computer understand binary language. Machine code ⬆️ ⬆️ Assembler ...
Program to search an element using binary search. #include<stdio.h> int main() { int i,a[10],n,b,c=0,l,f,mid; printf("Enter the size limit maximum is 10\n"); scanf("%d",&n); printf("Enter the array element\n"); for(i=0;i<n;i++) { scanf("%d",&a[i]); } printf("Enter the element to be searched\n"); scanf("%d",&b); f=0; l=n-1; while(f<=l) { mid=(f+l)/2; if(b<a[mid]) { l=mid-1; } if(b>a[mid]) { f=mid+1; } else if(b==a[mid]) { ...
Syntax of C-programming 4. A C program is divided into different sections. There are six main sections to a basic c program. The six sections are, Documentation Link Definition Global Declarations Main functions Subprograms 1. Documentation:- The documentation section is the part of the program where the programmer gives the details associated with the program. He usually gives the name of the program, the details of the author and other details like the time of coding and description. It gives anyone reading the code the overview of the code. 2.Link Section:- This part of the code is used to declare all the header files that will be used in the program. This leads to the compiler being told to link the header files to the system libraries. 3.Definition Section:- In this section, we define different constants...
Addition of two numbers in c language #include<stdio.h> int main() { int x,y,z; printf ("Enter two numbers"); scanf("%d%d",&x,&y); z=x+y; printf("Sum of two numbers are=%d",z); } OUTPUT Enter two numbers 4 5 Sum of two numbers are=9 Addition of two number is simple program of C-language.After reading this program you will be able to form simple mathematics addition . If you like this program then you can share it and for any issues you can direct contact with me from Home Page . For regular updates you can also follow my site. Next=>
Program to reverse one array into other array in C-language #include<stdio.h> int main() { int i,a[10],n,b[10]; printf("Enter the size limit maximum is 10\n"); scanf("%d",&n); printf("Enter the array element\n"); for(i=0;i<n;i++) { scanf("%d",&a[i]); } for(i=0;i<n;i++) { b[n-1-i]=a[i]; } printf("Reverse of array is\n"); for(i=0;i<n;i++) { printf("%d ",b[i]); } } OUTPUT Enter the size limit maximum is 10 4 Enter the array element 1 2 3 4 Reverse of array element is 4 3 2 1
Program to input an array elements and then display the same array in C-language #include<stdio.h> int main() { int i,a[10],n; printf("Enter the size limit maximum is 10\n"); scanf("%d",&n); printf("Enter the array element\n"); for(i=0;i<n;i++) { scanf("%d",&a[i]); } printf("Array element are\n"); for(i=0;i<n;i++) { printf("%d ",a[i]); } } OUTPUT Enter the size limit maximum is 10 4 Enter the array element 4 7 8 0 Array element are 4 7 8 0
Program to see ASCII symbol by entering number in C-language #include<stdio.h> int main() { char i; printf("Enter any number\n"); scanf("%d",&i); printf("ASCII symbol=%c ",i); } OUTPUT Enter any number 123 ASCII symbol={ By using this program you can see symbol and ASCII value . This small program further implement to see all ASCII Value if you want see all ASCII the Click If you like this program then you can share it and for any issues you can direct contact with me from Home Page . For regular updates you can also follow my site. Visit Homepage
Introduction of C-language 1. C-language was developed by Dennis Ritchie . In the year 1972 in Bell Laboratory in USA . C language suitable for system programmings ,it was mainly developed for UNIX operating system . Dennis Ritchie (1941-2011) Books:- The C Programming languages Dennis Ritchie also known as father of C-language. Use of C-language 👉🏿Operating system. 👉🏿Language Compiler. 👉🏿Text editor. 👉🏿Modern Program. 👉🏿Database. 👉🏿Language interpreter. 👉🏿Mobile & desktop application. 👉🏿 Gaming & Animation. ...
Comments
Post a Comment