Vraj Patel All Program
Vraj Patel All Program
#include<stdio.h>
int main ()
clrscr();
sum ();
getch();
sum ()
int a,b;
scanf("%d%d",&a,&b);
}
2. //WAC program UD function sum of two values
#include<stdio.h>
int main ()
int a,b;
clrscr();
scanf("%d%d",&a,&b);
sum (a,b);
getch();
}
3. //WAC program UD function sum of two values
#include<stdio.h>
int main ()
int a,b;
clrscr();
scanf("%d%d",&a,&b);
getch();
return x+y;
}
4. //WAC program UD function sum of two values
#include<stdio.h>
int main ()
clrscr();
getch();
sum ()
int a,b;
scanf("%d%d",&a,&b);
return a+b;
}
5. //WAC program to find sum of each digits ( Using UDF )
//with argument and NOT return.
#include<stdio.h>
#include<conio.h>
int digit(int );
int main()
int n;
clrscr();
scanf("%d",&n);
digit(n);
getch();
int digit(int N)
int rem,sum=0,temp=N;
while(N>0)
{
rem=N%10;
sum=sum+rem;
N=N/10;
}
6. //WAC program to find sum of each digits ( Using UDF )
#include<stdio.h>
#include<conio.h>
int digit(int );
int main()
int n;
clrscr();
scanf("%d",&n);
getch();
int digit(int N)
int rem,sum=0,temp=N;
while(N>0)
rem=N%10;
sum=sum+rem;
N=N/10;
return sum;
}
7. //WAC program to find sum of each digits ( Using UDF )
#include<stdio.h>
#include<conio.h>
int digit();
int main()
clrscr();
getch();
int digit()
int n,rem,sum=0;
scanf("%d",&n);
while(n>0)
rem=n%10;
sum=sum+rem;
n=n/10;
return sum;
}
8. //WAC program to find sum of each digits ( Using UDF )
#include<stdio.h>
#include<conio.h>
int digit();
int main()
clrscr();
digit();
getch();
int digit()
int n,rem,sum=0,temp;
scanf("%d",&n);
temp=n;
while(n>0)
rem=n%10;
sum=sum+rem;
n=n/10;
}
9. //WAC program to enter number and print its reverse
number ( Using UDF )
//with argument and NOT return.
#include<stdio.h>
#include<conio.h>
int rev(int );
int main()
int n;
clrscr();
scanf("%d",&n);
rev(n);
getch();
int rev(int N)
int rem,rev=0,temp=N;
while(N>0)
{
rem=N%10;
rev=rev*10+rem;
N=N/10;
}
10. //WAC program to enter number and print its revers number (Using
UDF)
#include<stdio.h>
#include<conio.h>
int rev(int );
int main()
int n;
clrscr();
scanf("%d",&n);
getch();
int rev(int N)
int rem,rev=0;
while(N>0)
{
rem=N%10;
rev=rev*10+rem;
N=N/10;
return rev;
}
11. //WAC program to enter number and print its revers number (
Using UDF )
#include<stdio.h>
#include<conio.h>
int rev();
int main()
clrscr();
getch();
int rev()
int n,rem,rev=0;
scanf("%d",&n);
while(n>0)
rem=n%10;
rev=rev*10+rem;
n=n/10;
return rev;
}
12. //WAC program to enter number and print its revers number (
Using UDF )
#include<stdio.h>
#include<conio.h>
int rev();
int main()
clrscr();
rev();
getch();
int rev()
int n,rem,rev=0,temp;
scanf("%d",&n);
temp=n;
while(n>0)
{
rem=n%10;
rev=rev*10+rem;
n=n/10;
}
13. //WAC program to enter number and chake given num
is palindrome or NOT ( Using UDF )
//with argument and NOT return.
#include<stdio.h>
#include<conio.h>
int pal(int );
int main()
int n;
clrscr();
scanf("%d",&n);
pal(n);
getch();
int pal(int N)
int rem,pal=0,temp=N;
while(N>0)
{
rem=N%10;
pal=pal*10+rem;
N=N/10;
if(temp==pal)
else
}
14. //WAC program to enter number and chake given num is palindrem
or NOT ( Using UDF )
#include<stdio.h>
#include<conio.h>
int pal(int );
int main()
int n,N;
clrscr();
scanf("%d",&n);
N=pal(n);
if(N==0)
else
getch();
int pal(int n)
int rem,pal=0,temp;
temp=n;
while(n>0)
rem=n%10;
pal=pal*10+rem;
n=n/10;
if(temp==pal)
return 0;
else
return 1;
}
15. //WAC program to enter number and chake given num is palindrem
or NOT ( Using UDF )
#include<stdio.h>
#include<conio.h>
int pal();
int main()
clrscr();
if(pal()==0)
else
getch();
int pal()
int rem,n,pal=0,temp;
scanf("%d",&n);
temp=n;
while(n>0)
rem=n%10;
pal=pal*10+rem;
n=n/10;
if(temp==pal)
return 0;
else
return 1;
}
16. //WAC program to enter number and chake given num is palindrem
or NOT ( Using UDF )
int pal();
int main()
clrscr();
pal();
getch();
int pal()
int rem,n,pal=0,temp;
scanf("%d",&n);
temp=n;
while(n>0)
rem=n%10;
pal=pal*10+rem;
n=n/10;
if(temp==pal)
else
}
17. //WAC program to enter number and chake given num
is prime or NOT ( Using UDF )
//with argument and NOT return.
#include<stdio.h>
#include<conio.h>
int count(int );
int main()
int n;
clrscr();
scanf("%d",&n);
count(n);
getch();
int count(int x)
int count=0,i;
for(i=1;i<=x;i++)
{
if(x%i==0)
count++;
if(count==2)
else
}
18. //WAC program to enter number and chake given num is prime or
NOT ( Using UDF )
#include<stdio.h>
#include<conio.h>
int count(int );
int main()
int n,N;
clrscr();
scanf("%d",&n);
N=count(n);
printf("\ncount = %d ",N);
getch();
int count(int n)
int count=0,i;
for(i=1;i<=n;i++)
if(n%i==0)
count++;
if(count==2){
return n;
else{
return n;
}
19. //WAC program to enter number and chake given num is prime or
NOT ( Using UDF )
#include<stdio.h>
#include<conio.h>
int count();
int main()
clrscr();
printf("\ncount = %d ",count());
getch();
int count()
int count=0,i,n;
scanf("%d",&n);
for(i=1;i<=n;i++)
if(n%i==0)
{
count++;
if(count==2){
return n;
else{
return n;
}
20. //WAC program to enter number and chake given num is prime or
NOT ( Using UDF )
#include<stdio.h>
#include<conio.h>
int count();
int main()
clrscr();
count();
getch();
int count()
int count=0,i,n;
scanf("%d",&n);
for(i=1;i<=n;i++)
if(n%i==0)
{
count++;
if(count==2)
else
}
21. // WAC program to enter num.. and chake given num.. is
even or odd (Using UDF)
// With argument and NOT return.
# include <stdio.h>
# include <conio.h>
int ev_odd(int );
int main ()
int n;
clrscr();
scanf("%d",&n);
ev_odd(n);
getch();
int ev_odd(int N)
{
if(N % 2 == 0)
else
}
22. // WAC program to enter num.. and chake given num.. is even or
odd (Using UDF)
# include <stdio.h>
# include <conio.h>
int ev_odd(int );
int main ()
int n;
clrscr();
scanf("%d",&n);
if(ev_odd(n) % 2 == 0)
else
{
getch();
int ev_odd(int N)
if(N % 2 == 0)
return 0;
else
return 1;
}
23. // WAC program to enter num.. and chake given num.. is even or
odd (Using UDF)
# include <stdio.h>
# include <conio.h>
int ev_odd();
int main ()
int n;
clrscr();
if(ev_odd() % 2 == 0)
else
{
printf(" Number is odd number \n");
getch();
int ev_odd()
int N;
scanf("%d",&N);
if(N % 2 == 0)
return 0;
else
return 1;
}
24. // WAC program to enter num.. and chake given num.. is even or
odd (Using UDF)
# include <stdio.h>
# include <conio.h>
int ev_odd();
int main ()
int n;
clrscr():
ev_odd();
getch();
int ev_odd()
int N;
if(N % 2 == 0)
else
}
25. //WAC progrem to find factorial of given number (Using UDF)
#include<stdio.h>
#include<conio.h>
int fact(int );
int main()
int i,n;
clrscr();
scanf("%d",&n);
fact(n);
grtch();
int i,fact=1;
for(i=N;i>=1;i--)
{
fact=fact*i;
}
26. //WAC progrem to find factorial of given number (Using UDF)
#include<stdio.h>
#include<conio.h>
int fact(int );
int main()
int i,n;
clrscr();
scanf("%d",&n);
getch();
int i,fact=1;
for(i=1;i<=N;i++)
{
fact=fact*i;
return fact;
}
27. //WAC progrem to find factorial of given number (Using UDF)
#include<stdio.h>
#include<conio.h>
int fact();
int main()
int i,n;
clrscr();
getch();
int fact ()
int i,fact=1,N;
scanf("%d",&N);
for(i=N;i>=1;i--)
{
fact=fact*i;
return fact;
}
28. //WAC progrem to find factorial of given number (Using UDF)
#include<stdio.h>
#include<conio.h>
int fact();
int main()
clrscr();
fact();
getch();
int fact ()
int i,fact=1,N;
scanf("%d",&N);
for(i=N;i>=1;i--)
fact=fact*i;
}
printf(" factorial is : %d ",fact);
}
29. //WAC program UD function to find sum,sub,mul,div of two value
#include<stdio.h>
int main ()
int a,b;
clrscr();
scanf("%d%d",&a,&b);
sum(a,b);
sub(a,b);
mul(a,b);
div(a,b);
getch();
}
30. //WAC program UD function to find sum,sub,mul,div of two value
#include<stdio.h>
#include<conio.h>
int main ()
int a,b;
clrscr();
scanf("%d%d",&a,&b);
getch();
int W=a+b;
return W;
int X=a-b;
return X;
int Y=a*b;
return Y;
}
31. //WAC program UD function to find sum,sub,mul,div of two value
#include<stdio.h>
int a,b;
int main ()
clrscr();
scanf("%d%d",&a,&b);
getch();
sum (){
return a+b;
sub(){
return a-b;
mul(){
return a*b;
return (float)a/b;
}
32. //WAC program UD function to find sum,sub,mul,div of two value
#include<stdio.h>
int a,b;
int main ()
clrscr();
sum ();
sub ();
mul ();
div ();
getch();
sum ()
sub(){
mul(){
}
33. //WAC program UD function to find sum,sub,mul,div of two value
using switch case
#include<stdio.h>
#include<conio.h>
int main ()
int a,b,N;
clrscr();
scanf("%d%d",&a,&b);
printf("_____________________________________
___________");
scanf("%d",&N);
switch (N)
break;
break;
break;
break;
getch();
int X=a-b;
int Y=a*b;
}
34. // WAC program to find sum of first 10 odd-evan number
#include<stdio.h>
#include<conio.h>
int sum_odd_evan();
int main()
clrscr();
sum_odd_evan();
getch();
int sum_odd_evan()
int i,s_odd=0,s_even=0;
for(i=1;i<=10;i++)
if(i % 2 == 0)
{
s_even+=i;
else
s_odd+=i;