Thursday , 28 March 2024
Home » Author Archives: Rajeel (page 4)

Author Archives: Rajeel

How to check if your Facebook account is compromised / Hacked by someone

There are a lot of ways in which your Facebook account may get hacked and many ways to protect them ( Read: How to protect your facebook account from hackers). But whatever you do, there are still many chances that your account may get hacked by someone or get compromised. The increasing number of exploits and vulnerabilities found makes the web and social networking riskier ... Read More »

C Program to Find if a year is Leap Year or not

Program: #include <stdio.h> main() { int year; clrscr(); printf("Enter a year to check if it is a leap year\n"); scanf("%d", &year); if ( year%400 == 0) printf("%d is a leap year.\n", year); else if ( year%100 == 0) printf("%d is not a leap year.\n", year); else if ( year%4 == 0 ) printf("%d is a leap year.\n", year); else printf("%d ... Read More »

C program to Find the Transpose of a given matrix

Program : #include int main() { int a[4][4],i,j,b; for(i=0;i<4;i++) { printf("\nEnter elements of %d row of Matrix: ",i+1); for(j=0;j<4;j++) scanf("%d",&a[i][j]); } for(i=0;i<4;i++) { for(j=i+1;j<4;j++) { b=a[i][j]; a[i][j]=a[j][i]; a[j][i]=b; } } printf("\n Transposed Matrix:\n\n"); for(i=0;i<4;i++) { for(j=0;j<4;j++) printf("%4d",a[i][j]); printf("\n"); } return 0; } Read More »

C Program to print Pascal’s Triangle

Program : #include <stdio.h> void main() { int num,x,y,a[50][50]; clrscr(); fflush(stdin); printf("Enter the number of rows: "); scanf("%d",&num); printf("\n Pascal's Triangle of Order %d\n\n",num); for(x=0;x{ for(y=0;y<=x;y++) { if(x==y || y==0) a[x][y]=1; else a[x][y]=a[x-1][y-1]+a[x-1][y]; printf("%4d",a[x][y]); } printf("\n\n"); } getch(); } Read More »

C program to implement Bubble sort

Bubble sort is a sorting technique where each two adjacent numbers are compared and the process is repeated until the whole list is sorted. This is less efficient but stable Program: #include int main() { int arr[100],i,j,n,temp; printf("Enter no. of terms\n"); scanf("%d",&n); printf("Enter the elements\n"); for(i=0;iarr[j+1]) { temp=arr[j]; arr[j]=arr[j+1]; arr[j+1]=temp; } } printf("Sorted elements are\n"); for(i=0;i Read More »

Scroll To Top