-
Ashifa wrote a new item 2 years, 4 months ago
#include #include main() { int a=10, b=20; //declaration of variables. clrscr(); //It clears the screen. printf(“Before swap a=%d b=%d”,a,b); a=a+b;//a=30 (10+20) b=a-b;//b=10 (30-20) a=a-b;//a=20 […]
-
Ashifa wrote a new item 2 years, 4 months ago
#include #include void main() { int n1=0,n2=1,n3,i,number; clrscr(); printf(“Enter the number of elements:”); scanf(“%d”,&number); printf(“n%d %d”,n1,n2);//printing 0 and 1 for(i=2;i
-
Ashifa wrote a new item 2 years, 4 months ago
#include #include void main() { int n1=0,n2=1,n3,i,number; clrscr(); printf(“Enter the number of elements:”); scanf(“%d”,&number); printf(“n%d %d”,n1,n2);//printing 0 and 1 for(i=2;i
-
Ashifa wrote a new item 2 years, 4 months ago
#include #include void printFibonacci(int n) // function to calculate the fibonacci series of a given number. { static int n1=0,n2=1,n3; // declaration of static variables. if(n>0){ n3 = n1 + n2; n1 = […]
-
Ashifa wrote a new item 2 years, 4 months ago
#include #include void printFibonacci(int n) // function to calculate the fibonacci series of a given number. { static int n1=0,n2=1,n3; // declaration of static variables. if(n>0){ n3 = n1 + n2; n1 = […]
-
Ashifa wrote a new item 2 years, 4 months ago
#include #include void main() { int n,i,m=0,flag=0; //declaration of variables. clrscr(); //It clears the screen. printf(“Enter the number to check prime:”); scanf(“%d”,&n); m=n/2; for(i=2;i
-
Ashifa wrote a new item 2 years, 4 months ago
#include #include main() { int n,r,sum=0,temp; clrscr(); printf(“enter the number=”); scanf(“%d”,&n); temp=n; while(n>0) { r=n%10; sum=(sum*10)+r; n=n/10; } if(temp==sum) printf(“palindrome number […]
-
Ashifa wrote a new item 2 years, 4 months ago
#include #include void main(){ int i,fact=1,number; clrscr(); printf(“Enter a number: “); scanf(“%d”,&number); for(i=1;i
-
Ashifa wrote a new item 2 years, 4 months ago
#include #include void main(){ int i,fact=1,number; clrscr(); printf(“Enter a number: “); scanf(“%d”,&number); for(i=1;i
-
Ashifa wrote a new item 2 years, 4 months ago
#include #include long factorial(int n) // function to calculate the factorial of a given number. { if (n == 0) return 1; else return(n * factorial(n-1)); //calling the function recursively. } void […]
-
Ashifa wrote a new item 2 years, 4 months ago
#include #include main() { int n,r,sum=0,temp; //declaration of variables. clrscr(); //It clears the screen. printf(“enter the […]
-
Ashifa wrote a new item 2 years, 4 months ago
#include #include main() { int n, reverse=0, rem; //declaration of variables. clrscr(); // It clears the screen. printf(“Enter a number: “); scanf(“%d”, […]
-
Ashifa wrote a new item 2 years, 4 months ago
The argument passed to the main() function while executing the program is known as command line argument. For example:
-
Ashifa wrote a new item 2 years, 4 months ago
The sprintf() stands for “string print.” The sprintf() function does not print the output on the console screen. It transfers the data to the buffer. It returns the total number of characters present in the string.
-
Ashifa wrote a new item 2 years, 4 months ago
malloc() The malloc() function is used to allocate the memory during the execution of the program. It does not initialize the memory but carries the garbage value. It returns a null pointer if it could not be able […]
-
Ashifa wrote a new item 2 years, 4 months ago
A pointer that doesn’t refer to any address of value but NULL is known as a NULL pointer. When we assign a ‘0’ value to a pointer of any type, then it becomes a Null pointer.
-
Ashifa wrote a new item 2 years, 4 months ago
C language was developed in 1972 at bell laboratories of AT&T.
-
Ashifa wrote a new item 2 years, 4 months ago
The getch() function reads a single character from the keyboard. It doesn’t use any buffer, so entered data will not be displayed on the output screen. The getche() function reads a single character from the […]
-
Ashifa wrote a new item 2 years, 4 months ago
The ANSI stands for ” American National Standard Institute.” It is an organization that maintains the broad range of disciplines including photographic film, computer languages, data encoding, mechanical parts, […]
-
Ashifa wrote a new item 2 years, 4 months ago
The union is a user-defined data type that allows storing multiple types of data in a single unit. However, it doesn’t occupy the sum of the memory of all members. It holds the memory of the largest member […]
- Load More
