Posts

Showing posts from September, 2011

c program to find sum of first n numbers

#include<stdio.h> #inclue<conio.h> void main() { int sum=0,n=1,l; printf("enter the limit"); scanf("%d",&l); while(n<=l) { sum=sum+n; } printf("sum of first %d numbers=%d",l); getch(); }

c program to generate odd numbers up to a limit

#include<stdio.h> #include<conio.h> void main() { int n,i; printf("enter the limit to generate odd nuymber") scanf("%d",&n); printf("generated odd numbers are"); for(i=1;i<n;i++)   if(i%2!=0) printf("%d",i); } getch(); }
CLICK HERE TO DOWNLOAD C++ AFTER DOWNLOADING  OPEN THE DOWNLOADED ZIP FILE CLICK INSTAL FILE THEN TYPE  C AND ENTER THEN ENTER THEN SELECT START INSTALLATION.......