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 are global variables?

877


Simplify the program segment if X = B then C ← true else C ← false

2805


Are local variables initialized to zero by default in c?

767


What is the best style for code layout in c?

839


What is floating point constants?

903


Why do we use stdio h and conio h?

859


In which header file is the null macro defined?

1123


a program that can input number of records and can view it again the record

1707


How can you return multiple values from a function?

850


What is the use of parallelize in spark?

769


What is the use of void pointer and null pointer in c language?

861


What is the size of empty structure in c?

820


What is the use of structure padding in c?

811


What is the use of bit field?

890


hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm

1826