C Tutorials

0

C Program to Sort Array Elements using Linear Sort

Program 1 // PROGRAM FOR SORTING OF ARRAY #include<stdio.h> #include<conio.h> int main() { int ar[500],n,i,j,temp; xyz:printf(“\nEnter limit for array”); scanf(“%d”,&n); if(n>500) { printf(“\nInvalid limit pls enter between 1 to 500”); goto xyz; } printf(“\nEnter...

0

C Program to Find Largest Element from an Array

Program 1 // Program to find max element for array #include<stdio.h> #include<conio.h> int main() { int ar[500],n,i,max,p; xyz:printf(“\nEnter limit for array”); scanf(“%d”,&n); if(n>500) { printf(“\nInvalid limit pls enter between 1 to 500”); goto xyz;...

0

C Program For Prime Number

Program 1 // Progrtam for prime number #include<stdio.h> #include<conio.h> int main() { int n,i=2,f=0; printf(“Enter a number”); scanf(“%d”,&n); while(i<n-1) { if(n%i==0) { f=1; break; } i++; } if(f==0) printf(“\nNo is prime”); else printf(“\nNo is...

0

C Program For Armstrong Number

Program 1 // Program for armstrong of number #include<stdio.h> #include<conio.h> int main() { int n,r,s=0,m; printf(“\nEnter a number”); scanf(“%d”,&n); m=n; while(n!=0) { r=n%10; s=s+(r*r*r); n=n/10; } if(m==s) printf(“No is armstrong”); else printf(“No is not...

0

C Program to Reverse Number

Program 1 // Program for reverse of individual digit of a number #include<stdio.h> #include<conio.h> int main() { int n,r,s=0,m; printf(“\nEnter a number”); scanf(“%d”,&n); m=n; while(n!=0) { r=n%10; s=s*10+r; n=n/10; } printf(“Reverse of %d is...

0

C Program to Check a Number is Palindrome or Not

Program 1 // Program for palindrom of number #include<stdio.h> #include<conio.h> int main() { int n,r,s=0,m; printf(“\nEnter a number”); scanf(“%d”,&n); m=n; while(n!=0) { r=n%10; s=s*10+r; n=n/10; } if(m==s) printf(“No is palindrom”); else printf(“No is not...

0

C Program For Menu Driven Application using Switch Case

Program 1 // Menu driven application using switch case #include<stdio.h> #include<conio.h> int main() { int a,b,c,choice; printf(“\n———————Menu——————\n”); printf(“\n 1.Addition\n2.Subtraction\n 3.Swaping\n”); printf(“\n———————————————\n”); printf(“\nEnter your choice”); scanf(“%d”,&choice); switch(choice) { case 1: { printf(“\nEnter two number”); scanf(“%d%d”,&a,&b);...

0

C Program For Goto Statement

Program 1 // Result Processing program, #include<stdio.h> #include<conio.h> int main() { int h,m,e,c,total,per; hindi:printf(“\nEnter marks of Hindi”); scanf(“%d”,&h); if(h>100) { printf(“\nInvalid marks of hindi enter again……….\n”); goto hindi; } eng:printf(“\nEnter marks of English”); scanf(“%d”,&e);...

string in c 0

Strings in C with Examples

Strings are one of the most fundamental data types in programming. Though C does not have a dedicated string data type, we can represent strings using character arrays. String manipulation forms an essential part...