answersLogoWhite

0


Best Answer

#include<stdio.h>

main()

{

int num1;

int num2;

int a;

printf("Enter any two numbers :");

scanf("%d%d",&num1,&num2);

for(a=num1;num1<=num2;a++)

{

if ( a % 2 == 1);

{

printf("%d",a);

}

}

getch();

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: In program c accept numbers num1 and num2 find the sum of all add numbers between the two numbers entered?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

A c program for multiplication of two integers a and b?

/*PROGRAM TO ACCEPT TWO NUMBERS FROM THE USER AND PRINT THEIR MULTIPLICATION. */ #include&lt;stdio.h&gt; #include&lt;conio.h&gt; void main() { int a, b, c; // Declaration of Variables. Variables 'a' &amp; 'b' to hold first &amp; second number. And 'c' to hold result. clrscr(); // To clear the output screen every time program is executed. printf("\n Enter the first number : "); scanf("%d", &amp;a); // To accept the first number. printf("\n Enter the second number : "); scanf("%d", &amp;b); // To accept the second number. c = a*b; // Logic to get the product of the entered two numbers. printf("\n Multiplication of %d &amp; %d = %d", a, b, c); // Displaying result. getch(); // To hold the output screen. }


Accept 5 numbers in an array and display it?

Accept 5 numbers in an array and display it.


How can you accept sum and print numbers without creating variables?

It is very easy. The program begins here..... /*Program to sum and print numbers without creating variables*/ #include&lt;stdio.h&gt; main() { clrscr(); printf("%d+%d=%d",5,2,5+2); getch(); } /*Program ends here*/ Now just by changing the numbers in the "printf" statement we can add, subtract, multiply and divide the numbers without using variables. Hence the problem is solved..........


Write the program in qbasic and add two numbers?

Cls input "enter two no.s ",a,b sum=a+b print "sum = ";sum end


A flowchart to Accept three numbers and check whether it firms to Pythagorean triplet?

Accept 3 natural numbers and check whether it firms pythagorean triplet

Related questions

Write a c program to accept a numbers and generate square root cube and exponential values?

write a c program to accept a number and generate a square root cube and exponential values


Design an algorithm that will accept a perons name from the screen entered as surname first name separated by a comma Your program is to display the name as first name followed by three blanks?

Design an algorithm that will accept a perons's name from the screen entered as surname, first name, separated by a comma. Your program is to display the name as frist name, followed by three blanks, followed by the surname. -defining diagram -pseudocode algorithm


Write a program to accept 2 numbers and tell whether the product of the two number is equal to or greater than 1000?

C programm


A c program for multiplication of two integers a and b?

/*PROGRAM TO ACCEPT TWO NUMBERS FROM THE USER AND PRINT THEIR MULTIPLICATION. */ #include&lt;stdio.h&gt; #include&lt;conio.h&gt; void main() { int a, b, c; // Declaration of Variables. Variables 'a' &amp; 'b' to hold first &amp; second number. And 'c' to hold result. clrscr(); // To clear the output screen every time program is executed. printf("\n Enter the first number : "); scanf("%d", &amp;a); // To accept the first number. printf("\n Enter the second number : "); scanf("%d", &amp;b); // To accept the second number. c = a*b; // Logic to get the product of the entered two numbers. printf("\n Multiplication of %d &amp; %d = %d", a, b, c); // Displaying result. getch(); // To hold the output screen. }


Accept 5 numbers in an array and display it?

Accept 5 numbers in an array and display it.


What happens when text is entered into a number field?

A number field will not accept text. If it does accept text, then it cannot be a number field. Text fields can accept digits, but number fields cannot accept other text. They will only accept digits and other numeric components, like a decimal point for example. Sometimes you will define a field for numbers, such as phone number or code numbers to be text fields. In fact, that is what you should do for that type of data. You never do calculations with phone numbers, like adding them or getting averages, so they can be stored in text fields, as there is no need for them to be stored in number fields. Also, a zero at the start of a phone number, would disappear if entered into a number field, and it would also not allow things like spaces or brackets.


How can you accept sum and print numbers without creating variables?

It is very easy. The program begins here..... /*Program to sum and print numbers without creating variables*/ #include&lt;stdio.h&gt; main() { clrscr(); printf("%d+%d=%d",5,2,5+2); getch(); } /*Program ends here*/ Now just by changing the numbers in the "printf" statement we can add, subtract, multiply and divide the numbers without using variables. Hence the problem is solved..........


Make a program that will accept any number n between 20-50 and another number x between 1-5 Then the program will display all numbers from 1-n that is divisible by x?

/* a number divisible by x should be a multiple of x */ int i, n,x; scanf ("%d", &amp;n); scanf ("%d",&amp;x); for(i=x;i =&lt; n;i+=x) { printf ("%d", x); }


Write the program in qbasic and add two numbers?

Cls input "enter two no.s ",a,b sum=a+b print "sum = ";sum end


How do you make it so text boxes in HTML only accept numbers?

Here is the HTML form input code to accept only numbers. You can change it to whatever fits your situation. The input type controls what the input form will accept. &lt;form&gt; Quantity (between 1 and 10): &lt;input type="number" name="quantity" min="1" max="10"&gt; &lt;/form&gt;


How do you write BASIC program to accept variables?

dim a input a


A flowchart to Accept three numbers and check whether it firms to Pythagorean triplet?

Accept 3 natural numbers and check whether it firms pythagorean triplet