jituTechnology

jituTechnology

Uncategorized

Write a program to declare two matrices in your program. Obtain matrix C=A+B and print it

A=2 1 3 7 6           B= 0 1 2 3 4   8 13 4 0 1             9 1 2 6 7   1 2 3 4 3              4 0 3 7 1 /* A program to declare two matrix […]

read more

Write a program to sort the data in ascending and descending order using selection sort.

/*program to sort the data in  ascending order using selection sort. Programmed by :Jitendra Kumar Yadav roll ni.: 10116 programmed on.: 21st mar,2011*/ #include <stdio.h> #include <conio.h> void main() { int i,j,temp; int arr[10]={2,1,6,5,8,4,9,7,10,3}; for (i=0;i<9;i++) { for (j=i+1;j<9;j++) { if(arr[i]>arr[j])//for descending change > to < { temp = arr[i]; arr[i] = arr[j]; arr[j] = […]

read more

Write a program to sort the data in ascending and descending order using bubble sort.

/*program to sort the data in ascending order using bubble sort. Programmed by :Jitendra Kumar Yadav roll ni.: 10116 programmed on.: 21st mar,2011*/ #include <stdio.h> #include <conio.h> void main() { int i,j,temp; int arr[10]={2,1,6,5,8,4,9,7,10,3}; for (i=0;i<10;i++) { for (j=0;j<10-i;j++) if(arr[j]>arr[j+1])// if you want for descending order then changeif(arr[j]>arr[j+1] to if(arr[j]<arr[j+1] { temp = arr[j]; arr[j] = […]

read more

Write a C program to read 10 numbers in an array and print in reverse order

//program to read 10 numbers in an array and print in reverse order. #include <stdio.h> #include <conio.h> void main () { int i,j; int a[10]; printf (“Enter 10 number\n”); for (i=0;i<10;i++) { scanf(“%d”,&a[i]); } printf(“The reverse is:\n”); for (j=9;j>=0;j–) printf (“%d\t”,a[j]); getch(); }

read more

Write a C program to read through an array of any type. Write a C program to scan through this array to find a particular value.

/*program to scan through this array to find a particular value programmed by: Name: Jitendra Kumar Yadav Roll: 10116 Date: 29 march 2011 */ #include <stdio.h> #include <conio.h> void main () { int i,n,index; int a[] = {1,2,3,4,5,6,7,8}; printf (“Enter a number from 1 to 8\n”); scanf (“%d”,&n); for (i=0;i<8;i++) { if (n==a[i]) index = […]

read more


Connect with Me

GPO 8973 NPC 541; Kathmandu Nepal
Phone: +977 9851236800

Calendar

May 2024
S M T W T F S
 1234
567891011
12131415161718
19202122232425
262728293031