write a c program, using for loop, that accepts and odds two
numbers. The output must be the sum and the addens. This
should be repeated 5 times while the first number is
decremented by one and the second number is incremented by 1.
Answer Posted / ankur srivastava
#include<stdio.h>
void main()
{int a,b,m=1;
printf("enter the two no\n");
scanf("%d %d",&a,&b);
while(m<=5)
{
printf("sum of %d and %d is %d \n",a,b,(a-- + b++));
m++;
}
}
Is This Answer Correct ? | 25 Yes | 7 No |
Post New Answer View All Answers
find level of following tree (state, parent) " J,D I,D H,C E,B F,B G,C B,A D,A C,A A,& K,E L,E L,F M,F N,G O,H P,I P,H Q,I R,J S,K U,P T,L
can you please write a program for deadlock that can detect deadlock and to prevent deadlock.
create a stucture student containing field for roll no,class,year and marks.create 10 student annd store them in a file
write a program that can LOCATE and INSERT elements in array using c++ programming languages.
Question 1: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date. *This Should Be Done IN C++
Code for Two Classes for Doing Gzip in Memory?
1+1/2!+1/3!+...+1/n!
Code for Small C++ Class to Transform Any Static Control into a Hyperlink Control?
write a program that creates a sequenced array of numbers starting with 1 and alternately add 1 and then 2 to create the text number in the series , as shown below. 1,33,4,6,7,9,............147,148,150 Then , using a binary search , searches the array 100 times using randomly generated targets in the range of 1 to 150
write a program to perform generic sort in arrays?
write a program that reverses the input number of n.Formulate an equation to come up with the answer.
write a function that reverse the elements of an array in place.The function must accept only one pointer value and return void.
write a program using virtual function to find the transposing of a square matrix?
write a function that allocates memory for a single data type passed as a parameter.the function uses the new operator and return a pointer to the allocated memory.the function must catch and handle any exception during allocation
How to swap two ASCII numbers?