Tag Archives: print

Write the functions to perform the following : 10m Dec2005

Write the functions to perform the following : 10m Dec2005  To accept a string and print the rightmost “n” characters   #include<stdio.h> #include<string.h> #include<alloc.h> char *rightsub(char *,int n); void main() { char s1[20],s2[20],ch,*s; int n; clrscr(); printf(“enter the string s1:”); gets(s1); printf(“enter the no of characters to extract=”); scanf(“%d”,&n); s=rightsub(s1,n); printf(“\nright sub string: %s”,s); free(s); getch();… Read More »

Write a program in ‘C’ to add the given number of days to the current date and print the (final) resultant date. (for e.g. adding 12 days to 22/08/2005 will result in 03/09/2005) 10m Dec2005

Write a program in ‘C’ to add the given number of days to the current date and print the (final) resultant date. (for e.g. adding 12 days to 22/08/2005 will result in 03/09/2005)  10m Dec2005     #include <time.h> #include <stdio.h> void  main() { struct tm date = {0} ; time_t timer; clrscr(); timer=time(NULL); date =… Read More »

Write an algorithm and draw a corresponding flow chart to print the sum of the digits of a given number

Write an algorithm and draw a corresponding flow chart to print the sum of the digits of a given number 10m Dec2005  An algorithm is a finite set of steps defining the solution of a particular problem. An algorithm is expressed in pseudo code – something resembling C language or Pascal, but with some statements… Read More »

ASSEMBLY18 An Assembly program to read in decimal inputs repeatedly untill a zero value is read, At this point it should print out the sum of the numbers read in so far

Now we will write another Assembly program to read  in decimal inputs repeatedly untill a zero value is read, At this point it should print out the sum of the numbers read in so far. Let’s identify variables needed for this program. First variables will be holding the Messages “ENTER NO.BETN (0-9) & (ENTER ZERO TO STOP) ” and “TOTAL SUM… Read More »

ASSEMBLY11 An Assembly program to Evaluate sphere volume if radius is given print result on Screen

Now we will write another Assembly program to Evaluate sphere volume if radius is given print result on Screen Let’s identify variables needed for this program. First variable will be the one which will hold the value entered by user in the variable R and Other variable RES will be holding the Resultant Decimal equivalent printable form to be printed… Read More »

An Assembly program in which a procedure converts Hexadecimal value to print its Decimal form on Screen

Now we will write another Assembly program in which a procedure converts Hexadecimal value to print its Decimal form on Screen Let’s identify variables needed for this program. First variables will be the one which will hold the value present in the variable NUM converts Hexadecimal value to print its Decimal form on Console (Screen) and Other… Read More »

ASSEMBLY09 An Assembly program to read in two decimal inputs and print out the smaller of the two, in decimal

Now we will write another Assembly program to read  two decimal inputs and print out the smaller of the two, in decimal Let’s identify variables needed for this program. First variables will be the one which will hold the values present in the variables to be Added and it will be NUM1 and NUM2 and Other variables will be holding… Read More »

ASSEMBLY08 An Assembly program to read in two decimal inputs and print out their sum, in decimal

Now we will write another Assembly program to read  two decimal inputs and print out their sum, in decimal Let’s identify variables needed for this program. First variables will be the one which will hold the values present in the variables to be Added and it will be NUM1 and NUM2. Other variable will be holding the Output or Result… Read More »

ASSEMBLY06 An Assembly program to read two decimal numbers, then multiply them together and finally print out the result (in decimal )

Now we will write another Assembly program to read  two decimal numbers, then multiply them together and finally print out the result (in decimal ) Let’s identify variables needed for this program. First variables will be the one which will hold the values present in the variables to be Multiplied and it will be NUM1 and… Read More »