write a 'c' program to sum the number of integer values

Answer Posted / arunkumar

#include<stdio.h>
#include<conio.h>

fun(int n);
int main()
{
int n=10;
printf("%d",fun(10));
}
fun(int n)
{
if(n<1)
return n;
else
return (n+fun(n-1));
}

Is This Answer Correct ?    5 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an array in c?

815


in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none

863


What do mean by network ?

919


What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }

960


What do you mean by dynamic memory allocation in c? What functions are used?

919


What type of function is main ()?

832


How can I find the modification date and time of a file?

856


WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.

2273


Can true be a variable name in c?

785


What is typeof in c?

793


Why doesnt that code work?

826


What is main return c?

766


Explain how do you determine whether to use a stream function or a low-level function?

872


What does struct node * mean?

826


What is structure pointer in c?

806