Tag Archives: number

CPP04 – (b) Write a CPP program to print whether a number is prime or not .

(b) Write a CPP program to print whether a number is prime or not . CODE:- #include<iostream.h> #include<conio.h> void main() { int NUM,I; clrscr(); cout<<“ENTER A NUMBER :”; cin>>NUM; for(I=2;I<NUM;I++) { if(NUM%I==0) break; } if(I==NUM) cout<<NUM<<” IS A PRIME NUMBER”<<endl; else cout<<NUM<<” IS NOT A PRIME NUMBER”<<endl; getch(); } [codesyntax lang=”cpp”] #include<iostream.h> #include<conio.h> void main()… Read More »

CPP04 – (a) Write a CPP program to print the factorial of a given number.

(a) Write a CPP program to print the factorial of a given number. CODE:- #include<iostream.h> #include<conio.h> void main() { int i,num; long fact=1; clrscr(); cout<<“Enter Number : “; cin>>num; for(i=num;i>0;i–) { fact=fact*i; } cout<<“Factorial = “<<fact<<endl; getch(); } [codesyntax lang=”cpp”] #include<iostream.h> #include<conio.h> void main() {   int i,num;   long fact=1;   clrscr();   cout<<“Enter… Read More »

Write and run an Assembly language program that converts an ASCII string containing decimal digits, stored in three consecutive locations in the memory into equivalent binary number – IGNOU MCA Assignment 2017 – 18

MASTER OF COMPUTER APPLICATIONS Course Code : MCSL-017 Course Title : C and Assembly Language Programming (Lab Course) Assignment Number : MCA(1)/L-017/Assignment/17-18 Maximum Marks : 50 Weightage : 25% Write and run an Assembly language program that converts an ASCII string containing decimal digits, stored in three consecutive locations in the memory into equivalent binary… Read More »

An assembly near procedure which converts the packed BCDdigits to equivalent binary number – IGNOU MCA Assignment 2017 – 18

MASTER OF COMPUTER APPLICATIONS Course Code : MCSL-017 Course Title : C and Assembly Language Programming (Lab Course) Assignment Number : MCA(1)/L-017/Assignment/17-18 Maximum Marks : 50 Weightage : 25% Write a program in 8086 assembly Language that passes a byte containing two packed BCD digits, as parameter to anear procedure named TOBINARY, which converts the… Read More »

Write a program in assembly language to check whether a number is even or odd – IGNOU MCA Assignment 2017 – 18

MASTER OF COMPUTER APPLICATIONS Course Code : MCSL-017 Course Title : C and Assembly Language Programming (Lab Course) Assignment Number : MCA(1)/L-017/Assignment/17-18 Maximum Marks : 50 Weightage : 25% Write a program in assembly language to check whether a number is even or odd – IGNOU MCA Assignment 2017 – 18 Code:- DATA SEGMENT MSG1… Read More »

Write a program to do linear search for an integer in 20 distinct numbers. The program should return the location of an element – IGNOU BCA Assignment 2015 – 16

BACHELOR OF COMPUTER APPLICATIONS Course Code : BCSL-045 Course Title : Introduction to Algorithm Design Lab Assignment Number : BCA(IV)/L-045/Assignment/2015 Maximum Marks : 50 Weightage : 25% Write a program to do linear search for an integer number in an array of 20 distinct numbers. The program should return the location of an element if… Read More »

Write a program in 8086 assembly Language to count the number of alphabets ‘a’, ‘e’ and ‘o’ (irrespective of lower or upper case) in a strings – IGNOU MCA Assignment 2015 – 16

 MASTER OF COMPUTER APPLICATIONS Course Code : MCS-012 Course Title : Computer Organisation and Assembly Language Programming Assignment Number : MCA(1)/012/Assign/2015-16 Maximum Marks : 100 Weightage : 25%   Write a program in 8086 assembly Language (with proper comments) to count the number of alphabets ‘a’, ‘e’ and ‘o’ (irrespective of lower or upper case)… Read More »

Write an 8086 assembly language program that finds the smallest and the second smallest number from a list of 10 numbers stored in memory. 7m Jun2008

Write an 8086 assembly language program that finds the smallest and the second smallest number from a list of 10 numbers stored in memory. 7m Jun2008 To understand program for Largest or Smallest in an array in detail Please Click this link below http://cssimplified.com/computer-organisation-and-assembly-language-programming/an-assembly-program-for-finding-the-largest-number-in-array-of-10-elements DATA SEGMENT ARR DB 5,3,7,1,9,2,6,8,4 LEN DW $-ARR SMALL DB ? SECOND… Read More »

Write a macro to find the smallest number among 3 given numbers. 7m Jun2007

Write a macro to find the smallest number among 3 given numbers. 7m Jun2007 Code: #include<stdio.h> #define MIN(X,Y)(X<Y ? X:Y) #define SMALL(X,Y,Z)(MIN(X,Y)<Z ? MIN(X,Y):Z) void main() { int FIRST,SECOND,THIRD; clrscr(); printf(“ENTER NUMBERS TO COMPARE\n”); printf(“\nFIRST NUMBER : “); scanf(“%d”, &FIRST); printf(“\nSECOND NUMBER : “); scanf(“%d”, &SECOND); printf(“\nTHIRD NUMBER : “); scanf(“%d”, &THIRD); printf(“\nThe SMALLER NUMBER IS… Read More »

A program in ‘C’ language which accepts enrollment number as input and prints the name of student. pairs of students in the form of a matrix. 10m Dec2007

Write a program in ‘C’ language which accepts the enrollment number of a student as input and prints the name of that student. The program should initially store information about the (name, enrollment number) pairs of students in the form of a matrix. 10m Dec2007   #include<stdio.h> struct student { unsigned long int ENROL; char… Read More »