Category: Computer

C programming code to display asterisk in a right angle triangle

Share This Topic:     Course Details Field of Study: Computer Science and Engineering Course Name: C Programming Course Description: C programming code to display asterisk in a right angle triangle below left diagonal Code #include<stdio.h> #include<conio.h> void main() { clrscr(); int n; printf(“Enter the number\n”); scanf(“%d”,&n); for(int i=1;i<=n;i++) { for(int j=1;j<=i;j++) { printf(“*”); } printf(“\n”); } getch();

C programming code to concatenate 2 sorted arrays in ascending order

Share This Topic:     Course Details Field of Study: Computer Science and Engineering Course Name: C Programming Course Description: C programming code to concatenate 2 sorted arrays in ascending order Code #include<stdio.h> #include<conio.h> void concatenate(int , int, int , int, int ); void main() { clrscr(); int a[100], b[100], m, n, c, sorted[200]; printf(“Enter the number of

C programming code to find minimum value of an array

Share This Topic:     Course Details Field of Study: Computer Science and Engineering Course Name: C Programming Course Description: C programming code to find minimum value of an array Code #include<stdio.h> #include<conio.h> void main() { clrscr(); int x[6]={70,29,3,8,30,76}; int min=x[0]; for(int i=0;i<6;i++) { if(x[i] < min) min=x[i]; } printf(“Minimum value is %d”,min); getch(); }

C programming code to add even and odd numbers up to n

Share This Topic:     Course Details Field of Study: Computer Science and Engineering Course Name: C Programming Course Description: C programming code to add even and odd numbers up to n Code #include<stdio.h> #include<conio.h> void main() { clrscr(); int n,sO=0,sE=0; printf(“Enter the number\n”); scanf(“%d”,&n); for(int i=1;i<=n;i++) { if(i%2==0) sE=sE+i; else sO=sO+i; } printf(“The sum of even Nos