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


Please Help Members By Posting Answers For Below Questions

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

2130


can you please write a program for deadlock that can detect deadlock and to prevent deadlock.

2839


create a stucture student containing field for roll no,class,year and marks.create 10 student annd store them in a file

2328


write a program that can LOCATE and INSERT elements in array using c++ programming languages.

3542


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++

663






Code for Two Classes for Doing Gzip in Memory?

2894


1+1/2!+1/3!+...+1/n!

2050


Code for Small C++ Class to Transform Any Static Control into a Hyperlink Control?

2658


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

3365


write a program to perform generic sort in arrays?

2716


write a program that reverses the input number of n.Formulate an equation to come up with the answer.

7172


write a function that reverse the elements of an array in place.The function must accept only one pointer value and return void.

4108


write a program using virtual function to find the transposing of a square matrix?

2964


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

2500


How to swap two ASCII numbers?

2553