# Category: Computer

## C programming code to sum numbers from 1 to n

Share This Topic:     Course Details Field of Study: Computer Science and Engineering Course Name: C Programming Course Description: C programming code to sum numbers from 1 to n Algorithm Accept the last number, n Add numbers from 1 to n using for loop Code #include<stdio.h> #include<conio.h> void main() { clrscr(); int n,sum=0; printf(“Enter a number.\n”); scanf(“%d”,&n);

## C Programming to display number patterns in right angle

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

## C Programming code to accept and display n numbers

Share This Topic:     Course Details Field of Study: Computer Science & Engineering Course Name: C Programming Description: C Programming code to accept and display n numbers i.e if n=5 it displays as 1 2 3 4 5 Algorithm Accept the number, n Display the numbers from 1 up to n using for loop Code #include<stdio.h> #include<conio.h>

## Add two numbers from registers – Microprocessor 8085 Code

Share This Topic:     Add two numbers from registers – Microprocessor 8085 Code Load the number 55H and A9 in Reg. B and Reg. C respectively. Add the content of Reg. B and C and store the result in memory location 201FH. Mnemonics Code MVI B,55H MVI C,A9H MOV A,C ADD B STA 201FH HLT Machine code