- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 7
- Posts with Downvotes
- 6
- Downvoting Members
- 6
11 Posted Topics
How can i call (execute) a file (with ".c" extention) from the particular path without including it into main file ? Now the file which we have to call from particular path is containing only a function (without "main()")..... | |
Re: hi.. [QUOTE] you just take while loop instead of if loop and store your result in array.... [CODE] #include<stdio.h> #include<conio.h> void main() { int x,y,*z,i=0,j; clrscr(); scanf("%d",&x); while(x>0) { y=x%10; z[i]=y; x=x/10; printf("%d\n",z[i]); i++; } for(j=0;j<i;j++) { printf("%d",z[j]); } getch(); } [/CODE] okay...just try this one... [/QUOTE] | |
Re: hi.. [CODE] #include<stdio.h> #include<conio.h> void main() { int n,i; clrscr(); printf("Enter N:- "); scanf("%d",&n); for(i=1;i<n;i++) { printf("1/%d + ",i); } printf("1/%d",i); getch(); } [/CODE] you can only print this series.. but if you want series with answer.. than you just have to add one equation in loop.. [ICODE] sum=sum+(1/i); [/ICODE] … | |
Re: #include<stdio.h> #include<conio.h> void main() { int x; double i,f=1; clrscr(); printf("Enter Number:-- "); scanf("%d",&x); printf("\n"); for(i=1;i<=x;i++) { f=f*i; printf(" %0.0lf",f); } getch(); } | |
I made a program... now i have to put one validation. "while program is executed, if i press "Esc" button (hardly situated in top-left corner) i will be out of my program, means its exicutation directly takes end." i tried by taking its ASCII value but i requires also ENTER … | |
hello, yesterday i was learning inheritance in C++... My teacher has told me that "Inheritance means using properties(variable,function etc) of one class to another class." but when i do it with example its not working.. [CODE=C++] #include<iostream.h> #include<stdio.h> class abc { int a,b,c; public: void exp1(); }; class xyz:public abc … | |
Re: [QUOTE=ynaffit;912298]i tried to create a program that would get the sum of the squares but i couldn't get the right output. Could u help me debug? and tell which part of my codes where wrong.PLEASE! [QUOTE=nirav99]firend hi... your program is totally correct but u r not getting ur output properly … | |
Re: [CODE]#include<iostream.h> #include<conio.h> #include<stdio.h> void main() { clrscr(); char st[25]; cout<<"Enter String:- "; gets(st); int n; n = strlen(st); int i; int count=0; for(i=0;i<=n;i++) { while(str[i] == NULL) { count=count+1; } } cout<<endl<<"Space:-"<<count; getch(); }[/CODE] | |
Re: if you have to make a fact. of x for(i=x;i>=1;i--) { fact=fact*i; // fact = 1 } cout<<fact; put this logic in your program.. it should be work.. | |
Re: #include<iostream.h> #include<stdio.h> #include<conio.h> int x; class factorial { public: void fact(); }; void factorial::fact() { clrscr(); int f=1; int i; for(i=x;i>=1;i--) { f=f*i; } cout<<endl<<"Factorial:-- "<<f; } void main() { clrscr(); cout<<"Enter Number:-- "; cin>>x; factorial f1; // Making an object of class factorial f1.fact(); //calling funtion fact() using object … | |
Re: well dont do this kind of hard working in a simple programm 1. Take array of 5 elements a[5] as u can scan the 5 numbers. 2. Also take another variable "temp" (for temporary use). 3. Now swapping & comparing every element of a[5] get the largest number. see in … |
The End.