Program to run code without main()

11 months ago Admin 0
Run code without main() This article illustrates the concept how to run code without main() in c/c++. Here is the source code and output of both the programs. C Programming language Program #include<stdio.h> #define run main void run() { printf("Welcome to Snapcout"); getch(); } After successfully compiling and executing the above C program,output is:- C++ Read More

Program to check vowel using switch statement

11 months ago Admin 0
Check vowel using switch statement This article illustrates the concept how to check vowel using switch statement in c/c++. Here is the source code and output of both the programs. C Programming language Program #include<stdio.h> #include<conio.h> void main() { char ch; clrscr(); printf("Input a character:- "); scanf("%s",&ch); switch(ch) { case'a': case'e': case'i': case'o': case'u': case'A': Read More

Program to reverse an entered alphabet

12 months ago Admin 0
Reverse an entered alphabet This article illustrates the concept how to reverse an entered alphabet in c/c++. Here is the source code and output of both the programs. C Programming language Program #include<stdio.h> #include<conio.h> #include<ctype.h> void main() { char alpha; clrscr(); printf("Enter an alphabet:- "); alpha=getchar(); printf("Reverse case of enter Alphabet is:- "); if(islower(alpha)) { Read More

Program to reverse the string

12 months ago Admin 0
Reverse the string This article illustrates the concept of how to reverse the string in c/c++. Here is the source code and output of both the programs. C Programming language Program #include<stdio.h> #include<string.h> #include<conio.h> void main() { char str,rev; int len,i; int j=0; clrscr(); printf("Enter the string:- "); gets(str); len=strlen(str); for(i=len-1;i>=0;i--) { rev=str; } rev='\0'; Read More

Program to reverse string using pointers

12 months ago Admin 0
Reverse string using pointers This article illustrates the concept how to reverse string using pointers in c/c++. Here is the source code and output of both the programs. C Programming language Program #include<stdio.h> #include<conio.h> void main() { char str,res; int i=0; char *strp=str; char *resp=res; clrscr(); printf("Enter a string :- "); gets(str); while(*strp) { strp++; Read More

Program to swap two numbers using pointers

1 year ago Admin 0
Swap two numbers using pointers This article illustrates the concept how to swap two numbers using pointers in c/c++. Here is the source code and output of both the programs. C Programming language Program #include<stdio.h> #include<conio.h> void main() { int num1,num2,*x,*y,temp; clrscr(); printf("Enter value of a:- "); scanf("%d",&num1); printf("Enter value of b:- "); scanf("%d",&num2); x Read More

Program to add two numbers using pointers

1 year ago Admin 0
Add two numbers using pointers This article illustrates the concept of how to add two numbers using pointers in c/c++. Here is the source code and output of both the programs. C Programming language Program #include<stdio.h> #include<conio.h> void main() { int num1,num2,*x,*y,result; clrscr(); printf("Enter first number:- "); scanf("%d",&num1); printf("Enter second number:- "); scanf("%d",&num2); x = Read More

Program to find sum of individual digits of number using function

1 year ago Admin 0
Find sum of individual digits of number using function This article illustrates the concept how to find sum of individual digits of number using function in c/c++. Here is the source code and output of both the programs. C Programming language Program #include<stdio.h> #include<conio.h> void main() { int num,res; clrscr(); printf("Enter Number:- "); scanf("%d",&num); res=sum(num); Read More

Program to find sum of individual digits of entered number

1 year ago Admin 0
Find sum of individual digits of entered number This article illustrates the concept how to find sum of individual digits of entered number in c/c++. Here is the source code and output of both the programs. C Programming language Program #include<stdio.h> #include<conio.h> void main() { int num,res=0,rem; clrscr(); printf("Enter number :- "); scanf("%d",&num); while(num!=0) { Read More

Program to identify missing number in entered array using function

1 year ago Admin 0
Identify missing number in entered array using function This article illustrates the concept how to identify missing number in entered array using function in c/c++. Here is the source code and output of both the programs. C Programming language Program #include<stdio.h> #include<conio.h> int missingnumber(int,int); void main() { int arr,size,i,result; clrscr(); printf("Enter number of elements you Read More