C PROGRAM TO PRINT NUMBERS 1 TO N WITHOUT USING LOOPS
#include<stdio.h> void print_numbers(int,int); //declaring function definition main() { int n; printf("\n *** C PROGRAMS BLOG ***"); printf("\n >>> Program to print numbers 1 to n without using Loops <<<"); printf("\n\n Enter the value of n: "); scanf("%d",&n); //taking value of n as input from user print_numbers(1,n); //calling the function getch(); } void print_numbers(int i,int max) { printf("%3d\t",i); if(i<max) {//calling function recursively print_numbers(++i,max); } return; }
Sample Output :
Good
ReplyDeleteHere is a link for C/C++ programs and pointer programs. This may be useful for you.
C/C++ Programs
BA/BCOM/BSC/BBM/COMPUTER/IT/DIPLOMA RESUMES
ReplyDeletehttp://topjobssearchblog.blogspot.in/
Computaholics Provide Programming Example of C,Java program,Opengl program,Hadoop fs commands & Tutorial,Cse Engineering project
ReplyDeletehttp://www.computaholics.in/
http://www.computaholics.in/2015/12/hdfs.html
http://www.computaholics.in/2015/12/mapreduce.html
http://www.computaholics.in/2015/11/hadoop-fs-commands.html
http://www.computaholics.in/2016/01/internet-of-things.html
Thanks for sharing ur valuable inforamtion ,we also provide C programming languages classes in bangalore,visit : <a href="http://www.aptechyelahanka.com/c-courses-bangalore/>Aptech computer education</a>,my tage are : C training bangalore,C courses bangalore,C classes bangalore,C institute bangalore,C coaching centers bangalore,C programming institute in bangalore,C programming classes in bangalore
ReplyDeletethanks for this post its really help me in coding by the way did you know what are the datatypes in c programming language
ReplyDeleteThank you for sharing very informatics and useful post about very useful info.... Turbo-IVP (Invoice Validation Portal) and Turbo eSigner
ReplyDeleteThanks for sharing nice information. I am really looking for these kind of blog. Keep sharing. c programming classes in pune
ReplyDeletelearn c programming free tutrioal the link is: beginerinprogramming.blogspot.com
ReplyDelete#include
ReplyDeletevoid sum(int,int); /*declaring prototype of function*/
void main()
{
int a,b,c;
printf("\n Enter the two numbers : ");
scanf("%d %d",&a,&b); /* taking two numbers as input*/
c = sum(a,b); /* calling function,
*the value returned by the function is stored in c */
printf("The sum of two numbers is : %d",c);
getch();
}
void sum ( int num1,int num2)
{
int result; /* defining variable, its scope lies within function */
result = num1 + num2 ; /*adding two numbers*/
printf ("sum=%d",result);
}
what is error in this program. i want to add 2 number using calling funtion with no return.
Hi,
Deletec = sum(a,b); this line is wrong, you sum function is not returning anything, then you cannot store any value in c varialble
Nice Blog !
ReplyDeleteComputer Science
good logic and help me a lot in logic building.even we can do the same program with the help of recursion. http://onlinedigitaltechnology.com/control-structure/
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThank for your kind Information, keep posting and do post something about Embedded System Programming also.
ReplyDeleteThank for your kind Information, keep posting and do post something about Embedded System Programming also.
ReplyDeleteMadaalarqam we provide best electronic trade platforms for consumer and reseller. We also develop all types of Programming applications
ReplyDeletethank you for sharing useful info
ReplyDeleteweb programming tutorial
welookups
thanks sir for providing this c programming examples with output
ReplyDeleteThanks sir for providing c programming examples
ReplyDeleteVidmate for android
ReplyDeleteThank you so much for sharing this amazing blog with us. Anyone who are searching for more, free training's like C, Python, Java, Asp.Net, Nodejs and more programming languages please contact Nareshit.
ReplyDeleteNodeJS Online Training
Eumaxindia specializing in Radio Advertising like suryan fm,redfm,big92.7fm,radio city,hello106.4fm.we are provides all types of online radio advertising.
ReplyDeleteCreative radio ads Chennai
This is a nice blog related to C program anyone wants to Learn about how does the program process in the memory, what is debugging etc. Refer->https://solveprogram.com/
ReplyDeleteThanks admin for the post, Its really a nice post and Looking for more blogs like this. Please stay updated..!
ReplyDeleteLearn Entity Framework
Thanks for the programs. I read theory from here but looking for programs.
ReplyDeleteThanks for providing the programs.
helpful article best app developer and app developer"
ReplyDeleteGreat Content. It will useful for knowledge seekers. Keep sharing your knowledge through this kind of article.
ReplyDeleteNode JS Training in Chennai
Perl Training in Chennai
ReplyDeleteNice blog! Thanks for sharing this valuable information
Angularjs Training in Bangalore
Angularjs classes in pune
Angularjs Training in hyderabad
Angularjs Training in Gurgaon
Angularjs Training in delhi
This post is so interactive and informative.keep updating more information...
ReplyDeleteArtificial Intelligence Course in Mumbai
Artificial Intelligence Course in Ahmedabad
Artificial Intelligence Course in Kochi
Artificial Intelligence Course in Trivandrum
Artificial Intelligence Course in Kolkata
ReplyDeleteGet inspired by your blog. Keep doing like this....
Spoken English Classes in Bangalore
Spoken English Classes in Pune
spoken english centre in Hyderabad
English Speaking Course in Gurgaon
English speaking course in Delhi
Great Post and valuable...This post is so informative...
ReplyDeletethis is such an amazing blog which gives you the most required information.
ReplyDeleteOracle Training institute in chennai
oracle online training
oracle training center in Coimbatore
This post is so helpfull and informative.keep updating with more information...
ReplyDeleteHacker Interface
Hacking Technology
Most useful information!!! Thanks for it.
ReplyDeletePython Course in Chennai
Learn python online
Python Course in Coimbatore
This post is so helpfull and informative.keep updating with more information...
ReplyDeleteSwift Developer Training In Mumbai
Swift Developer Certification Training In Ahmedabad
Swift Developer Certification Training In Kochi
Swift Developer Certification Training In Trivandrum
Swift Developer Training In Kolkata
Wonderful Blog post!!! I am more impressed with your data.
ReplyDeleteWhy Pointers are not Used in Java
Why Java Doesn't Support Pointers
ReplyDeleteThank you, This was the best and most interesting course. please continue to share your thoughts.
RPA Training in Chennai
RPA Training Online
RPA Training In Bangalore
ReplyDeleteNice post Thank for sharing
DevOps Online Training
DevOps Training in Chennai
DevOps Training in Bangalore
React.js offers a faster development environment, and its very easy to use. Learn them without taking care of too many setups, when you are developing apps by serving HTML files.
ReplyDeleteLearn How to Use Reactjs Cdn
Nice Post.
ReplyDeletealso,check Full stack training in Pune