answersLogoWhite

0


Best Answer

#include
#include
void main()
{
int n;
void print(int n);
clrscr();
printf("Enter the number:");
scanf("%d",&n);
print(n);
getch();
}
void print(int n)
{
int i;
for(i=1;i<=10;i++)
{
if(n%2!=0)
n+=2;
else
n+=1;
printf("%2d.%2d\n",i,n);
}
}

Output:
Enter the number:5
1. 7
2. 9
3.11
4.13
5.15
6.17
7.19
8.21
9.23
10.25
Enter the number:4
1. 5
2. 7
3. 9
4.11
5.13
6.15
7.17
8.19
9.21
10.23

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Program to accept n number from user and dispay its next 10 odd number using function?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Math & Arithmetic
Related questions

Write a statementin a java program to read 2 integers and dispay the number of interagers between them?

a=153 a=n%10;


How does Excel dispay year?

Excel can display the year as a number. You can get it to display in different ways as part of a full date, such as having 2 or 4 digits to represent it. There is also a YEAR function, to extract just the year from a full date, which is then displayed as a number.


What function enables the user to input information while the program is being executed in c?

The scanf() function is a commonly used function to input information during the execution of a program. scanf() function has its prototype in the stdio.h header file. To accept and display a number: int num; printf("Enter a number: "); scanf("%d",&amp;num); printf("You entered %d",num); To accept and display a character, replace %d with %c and make num a character variable [char]. Plus: gets, fgets, read, fread, getchar, getc, fgetc, getch...


Write a program that read phrase and print the number of lower-case letter in it using function of counting?

write a program that reads a phrase and prints the number of lowercase latters in it using a function for counting? in C program


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


What is ellipsis operator in c?

It somehow tells the compiler that the function will accept an unknown number of parameters.


Which header file should you include if you are to develop a function which can accept variable number of arguments?

stdarg.h


Write a Program to convert decimal number into hexadecimal no without using function and string?

This is not a question.


How can I write a program to display prime numbers from 1 to 100?

Write a function that implements an algorithm that checks to see if a particular integer is prime (returning a boolean). Write a program that uses that function on each number from 1 to 100, and if true, displays that number.


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


How do you write a program using function that counts the number of vowels in a string in java language?

Use text-editor notepad++


What is a prototype within a program?

Prototyping is done (at least in C/C++) to declare a function and tell the compiler how to use it before the int main(void) part of the program is run. The function is declared after main and is usually done as a style thing. example int function(int); int main(void) { int anumber = 1; x = function(anumber); return 0; } int function(int number) { //do something return number; } et cetera et cetera...