my first five programs of Tuesday: 1. program to swap two numbers without using third variable main(){ int a,b; a=100; b=220; a=a+b; b=a-b; a=a-b; printf("a=%d , b=%d",a,b); } 2. program to check whether a number is even or odd without using modulus(%) operator main(){ int n; printf("Enter a number"); scanf("%d",&n); if(n&1){ printf(" %d is odd number",n); } else{ printf(" %d is even number",n); } } 3. program to check even or odd without modulus and bitwise operator main(){ int n; printf("Enter a number"); scanf("%d",&n); if(n/2*2==n){ printf(" %d is even number",n); } else{ printf(" %d is odd number",n); } } 4. program to print a table of user’s choice main(){ int n,i; printf("Enter a number"); scanf("%d",&n); for(i=1;i
Add two no. Without using "+" operator between them:: main(){ int x,y ; printf("enter two numbers"); scanf("%d %d",x,y); while(y >0) { x++; y--; } printf("result is=%d",x); }
@@aayushbansal7097 good question:: main(){ int x,y; printf("enter 2 no."); scanf("%d %d",&x,&y); if(y>0) { while(y>0) { x++; y--; } } else { y=abs(y); //take absolute of y while(y>0) { x--; y--; } } printf(x); } I hope it will give u correct answer now.
//6:- is divisible by 5 or not int main() { int a; printf("Enter a number"); scanf("%d",&a); if(a%5==0) printf("%d is divisible by 5",a); else printf("%d is not divisible by 5",a); return 0; }
29.accept a no from user and display maximum and minimum digit. Void main() { int n,max, min, r; Printf("enter a num" ) ; Scanf("%d", & n) ; max=min=n%10; n/n10; For( ; n! =0; n=n/10) { r=n%10; if (r>max) max=r; elase if (r
Today i did more than 5 ..like Prime number and factoral number with recursion and also without recursion.. Armstrong number,reverse,sum of digits.,swap number without 3rd variable,palindrom...etc.
this logic results in an extra bit. Better approach would be to use bitwise X-OR Operator. #include int main() { int a,b; a=2,b=3; a=a^b; b=a^b; a=a^b; printf("after swapping value of a is: %d and b is %d",a,b); }
27. Accept 5 no from user and display its maximum no. Void main() { int i, n,max=0; For(i=1;imax) { max=n; } } Printf("maximum no is %d", max) ; getch() ; }
Coding is the life . I am promise with me only . I am submitting 10 program . Actual I am a java developer . I am doing the work right now. Love you coading .
Sir i learn c language from u when I was in first year today I working as a android developer in a product base company 🙂ungli pakad ke chalna sikhya h apne thanku dil se☺
From 7 months I am doing job as a full time developer, if u still don't believe its ok bro it's doesn't effect on my pay check which company gives me every month. 😎
todays 7 programs here...... date:27-2-2020 sir i have a one question pls ans me, sir how to remove nonportable pointer conversion warning ..... sir pls give me answer. #include #include int insertfirst(char*,char);// 1.In the given string insert a character on the first position. int insertlast(char*,char);// 2.In the given string insert a character on the last position. int givenposition(char*,char,int);// 3.In the given string insert a character on the given position. int replace(char*,char,char);// 4.In the given string replace a character. int translate(char*,char*,char*);// 5.In the given string replace a string from string. // ie: i give string abcdefbadce and this string bc is replace with xy so from my code // we found output axydefxadye int removegiven(char*,char);// 6. In the given string remove give character. void countfreqency(char*);// 7.In the given String count frequency of each character. int insertfirst(char*a,char ch) { int i,temp; for(i=0;i
Respected sir, I am sonu kumar from patna,bihar. I am studying in 4th semester computer science Engineering at new government polytechnic,patna - 13. I will do 10 programs submit per day. Thanks sir 🙏🙏 for this challenge.
38. Disp sum of all digit of a no. Void main() { int n, i, s=0; Printf("enter a num" ) ; Scanf("%d", & n) ; while(n>0) { r=n%10; s=s+r; n=n/10; } Printf("%d", s) ; getch() ; }
I'm currently preparing for upcoming NIMCET exam so I can't spend a lot of time in programming. But I accept your challenge I'll do atleast 3 code per day.
8:Number is even or odd? #include void main() { int num; printf("Enter a number:"); scanf("%d",&num); if(num%2==0) printf("Even"); else printf("Odd"); } 9:Year is leap year or not? #include void main() { int yr; printf("Enter a year: "); scanf("%d", &yr); if (yr % 4 == 0) { if (yr % 100 == 0) { if (yr % 400 == 0) printf("%d is a leap year.", yr); else printf("%d is not a leap year.", yr); } else printf("%d is a leap year.", yr); } else printf("%d is not a leap year.", yr); } 10:Number is Prime or not? #include void main() { int num,i,flag=0; printf("Enter a number: "); scanf("%d",&num); if(num==1) printf("Not a prime"); else if(num==2) printf("Prime"); else { for(i=2;i
8:Number is even or odd? #include void main() { int num; printf("Enter a number:"); scanf("%d",&num); if(num%2==0) printf("Even"); else printf("Odd"); } 9:Year is leap year or not? #include void main() { int yr; printf("Enter a year: "); scanf("%d", &yr); if (yr % 4 == 0) { if (yr % 100 == 0) { if (yr % 400 == 0) printf("%d is a leap year.", yr); else printf("%d is not a leap year.", yr); } else printf("%d is a leap year.", yr); } else printf("%d is not a leap year.", yr); } 10:Number is Prime or not? #include void main() { int num,i,flag=0; printf("Enter a number: "); scanf("%d",&num); if(num==1) printf("Not a prime"); else if(num==2) printf("Prime"); else { for(i=2;i
Priyanka ji I am new In this field Kya AP btaa sakte ho ke apka program without. #includ Or run kese ho raa ha jab apne header file nahi lgai to printf has ha prototype ka error show nahi hoga
14 //perimeter of triangle #include #include int main(){ float a,b,c,s,peri,area=0.0; printf("Enter values of 3 sides of a triangle :"); scanf("%f%f%f",&a,&b,&c); s=(a+b+c)/2; peri=a+b+c; area=(float)sqrt(s*(s-a)*(s-b)*(s-c)); printf(" The sides of the triangle are:%f,%f,%f",a,b,c); printf(" The perimeter of the triangle is:%f",peri); printf(" The area of the triangle :%f",area); return 0; }
Ptogram to Find length of string #include Void main() { char s[ ] = "ashutosh"; int i; for (i = 0; s[i] != '\0'; ++i); printf("Length of the string: %d", i); getch (); }
My third five programs on thursday 1.Function power(a,b),to calculate the value of a raised to b. #include long power(int,int); int main() { int x,y; long pow; printf(" Enter two numbers:"); scanf("%d %d",&x,&y); pow=power(x,y); printf("%d to the power %d=%d ",x,y,pow); return 0; } long power(intx,inty) { int i; long p=1; for(i=1;i
1. Write a program that converts Centigrade to Fahrenheit. #include int main() { float cent,faren; printf("Enter temperature in centigrade:"); scanf("%f",¢); faren = (1.8*cent)+32; printf("temperature in farenhite: %f",faren); return 0; }
👉WELCOME TO MY COMMENT BOX😇 NAME >> Suyash soni B.tech student ; 1st year ;LNCT college BHOPAL🙏 >>==DAY---1== 0) { printf("positive"); } else { printf("non positive"); } getch(); } ""FIFTH PROGRAM TO FIND THE AREA OF A RECTANGLE"" main() { int L,B,A; printf("Enter length"); scanf("%d",&L); printf("Enter breadth"); scanf("%d",&B); A=L*B; printf("Area is%d",A); getch(); }
(1)Find factorial :-- #include #include Void main () { Int i,x ; Int result=1; Clrscr(); Printf(" Enter a No. Which you want to find factorial"); Scanf("%d"&x); For(i=x;x>0;i--) { result=result*i; } Printf("Your factoril is %d ", result); getch(); } (2)Swap two no using of third variable:- #include #include Void main () { Int a,b,s; Clrscr(); Printf("Enter two No. "); Scanf("%d,%d" &a,&b); Printf(" Before swaping your No.is ::"); s=a; a=b; b=s; Printf(" After swaping your No.is :: %d%d" a,b); getch(); } (3)Swap two no without using of third variable:- #include #include Void main () { Int a,b,; Clrscr(); Printf("Enter two No. "); Scanf("%d,%d" &a,&b); Printf(" Before swaping your No.is ::"); a=a+b; b=a-b; a=a-b; Printf(" After swaping your No.is :: %d%d" a,b); getch(); } (4) Create a table for users.. #include #include Void main () { int i,x,y; clrscr(); Printf("Enter No which you create table"); Scanf("%d" &x); for(i=1;i
7.Consecutive!!! (100 Marks) For this challenge, you need to take number of elements as input on one line and array elements as an input on another line. You need to tell whether the numbers present in the array are consecutive or not. #include using namespace std; int main() { int n,k=0; cin>>n; int a[n]; for(int i=0;i>a[i]; for(int i=0;i
write a progaram to check whether a given number is positive negtive zero...? main() { int a; printf("enter the number"); scanf("%d",&a); if(a>0) { printf("positive"); } else if(a
21.find the sum of first digit and last digit of given number #include int main() { long long int num,firstdigit,lastdigit,sum=0; printf("enter the number "); scanf("%lld",&num); lastdigit=num%10; while(num>=10) { num=num/10; } firstdigit=num; sum=firstdigit+lastdigit; printf("sum=%lld",sum); }
4th day of challenge 1.C program to calculate and print the value of nPr #include void main() { int n, r, npr_var; printf("Enter the value of n:"); scanf("%d", &n); printf(" Enter the value of r:"); scanf("%d", &r); npr_var = fact(n) / fact(n - r); printf(" The value of P(%d,%d) is: %d",n,r,npr_var); } int fact(int num) { int k = 1, i; if (num == 0) { return(k); } else { for (i = 1; i
5. Maximum Vs Minimum (100 Marks) For this challenge, you need to take number of elements as input on one line and array elements as an input on another line. You need to find the minimum number and maximum number from the array and multiply them. #include using namespace std; int main() { int n; cin>>n; int a[n]; for(int i=0;i>a[i]; int min=a[0],max=a[0]; for(int i=1;i
2. Write a C program that calculates the volume of a sphere. #include int main() { float r,v; printf("Enter radius of s sphere:"); scanf("%f",&r); v = 4.0/3.0*3.14*r*r*r; printf("The volume of a sphere is %f",v); return 0; }
9. Write a C program to read the value of an integer m and display the value of n is 1 when m is larger than 0, 0 when m is 0 and -1 when m is less than 0. #include int main() { int m,n; printf("enter the value of m:"); scanf("%d",&m); if(m>0) printf("the value of n = 1"); else if(m==0) printf("the value of n = 0"); else printf("the value of n = -1"); return 0; }
My first five programs..... 1. Program to Calculate avg. Marks of maths subject for 30 students. Main() { Int m[30],i,sum=0; Float avg; Printf("enter marks and maths for 30 students"); For(i=0;i
(5) convert binary to decimal #include #include int convert(long long n); int main() { long long n; printf("Enter a binary number: "); scanf("%lld", &n); printf("%lld in binary = %d in decimal", n, convert(n)); return 0; } int convert(long long n) { int dec = 0, i = 0, rem; while (n != 0) { rem = n % 10; n /= 10; dec += rem * pow(2, i); ++i; } return dec; }
// 1st program for Tuesday addition of two numbers #include int main() { int a,b,sum; printf("Enter two number "); scanf("%d%d",&a,&b); sum=a+b; printf("sum of %d",sum); }
4. War between odd and even For this challenge, you need to take number of elements as input on one line and array elements as an input on another line. You need to find the numbers that are present at odd index, add them. find the numbers that are present at even index, add them and then subtract the smallest of the two values from the lager one. #include using namespace std; int main() { int n; cin>>n; int a[n]; for(int i=0;i>a[i]; int odd=0,even=0; for(int i=0;ieven) cout
33. Accept maerk of 10 student from user and count how many students are pass with sec division.. Void main() { Int i, msk, ns=0; i=1; While(i=45 && msk
// program 18: calculate circumference of circle #include #include void main() { int radius, circumference; printf ("enter the radius of circle"); scanf("%d",&radius); circumference=2*3.14*radius; printf("%d", circumference ); getch(); }
41. Accept num from user and copy it in another variable at reverse order. Void main() { int n, r=0, rev=0; Printf("enter a num" ) ; Scanf("%d", & n) ; while(n>0) { r=n%10; rev=rev*10+r; n=n/10; } Printf("reverse no is%d", rev) ; getch() ; }
My five program are : 1.addition of two numbers . #include Int main() { Int a, b ,c; Printf("enter the number: "); Scanf("%d",&c); C=a+b; } 2.subtraction of two number #include main() { Int a, b ,c; Printf("enter the number: "); Scanf("%d",&c); C=a-b; }
34.accept 5 num from user and disp 2nd maximum. Void main() { Int i, maxs=0,max=o; i=1; While(imax) { maxs=max; max=n; } else if (n>max) { max=n;} i++; } Printf("second maximum %d=", maxs) ; getch() ;
16. Write a C program to calculate profit and loss on a transaction. #include int main() { int cp,sp,loss,profit; printf("Enter cost price:"); scanf("%d",&cp); printf("Enter selling price:"); scanf("%d",&sp); if(sp>cp) { profit = sp-cp; printf("Profit = %d",profit); } else { loss = cp-sp; printf("Loss = %d",loss); } return 0; }
39. Accept no from user and disp maximum digits.. Void main() { int n, r, max=0; Printf("enter a num" ) ; Scanf("%d", & n) ; while(n>0) { r=n%10; if(r>max) { max=r; } n=n/10; } Printf("maximum digits is %d", max) ; getch() ; }
my first five programs of Tuesday:
1. program to swap two numbers without using third variable
main(){
int a,b;
a=100;
b=220;
a=a+b;
b=a-b;
a=a-b;
printf("a=%d , b=%d",a,b);
}
2. program to check whether a number is even or odd without using modulus(%) operator
main(){
int n;
printf("Enter a number");
scanf("%d",&n);
if(n&1){
printf("
%d is odd number",n);
}
else{
printf("
%d is even number",n);
}
}
3. program to check even or odd without modulus and bitwise operator
main(){
int n;
printf("Enter a number");
scanf("%d",&n);
if(n/2*2==n){
printf("
%d is even number",n);
}
else{
printf("
%d is odd number",n);
}
}
4. program to print a table of user’s choice
main(){
int n,i;
printf("Enter a number");
scanf("%d",&n);
for(i=1;i
No 4. program is like my..
It can be in short term
Very easy and interesting questions
@@YashDEVELOPER12 nice
Add two no. Without using "+" operator between them::
main(){
int x,y ;
printf("enter two numbers");
scanf("%d %d",x,y);
while(y >0)
{
x++;
y--;
}
printf("result is=%d",x);
}
But what if user enter a negative value of y
@@aayushbansal7097 good question::
main(){
int x,y;
printf("enter 2 no.");
scanf("%d %d",&x,&y);
if(y>0) {
while(y>0) {
x++;
y--; } }
else {
y=abs(y); //take absolute of y
while(y>0)
{
x--;
y--; } }
printf(x);
}
I hope it will give u correct answer now.
There is an error in scanfehich &
gud
//6:- is divisible by 5 or not
int main()
{ int a;
printf("Enter a number");
scanf("%d",&a);
if(a%5==0)
printf("%d is divisible by 5",a);
else
printf("%d is not divisible by 5",a);
return 0;
}
29.accept a no from user and display maximum and minimum digit.
Void main()
{
int n,max, min, r;
Printf("enter a num" ) ;
Scanf("%d", & n) ;
max=min=n%10;
n/n10;
For( ; n! =0; n=n/10)
{
r=n%10;
if (r>max)
max=r;
elase if (r
checking leep year
n= int(input())
if(n%4==0 and n%100!=0 or n%400==0):
print("yes")
else:
print("yes")
Today i did more than 5 ..like
Prime number and factoral number with recursion and also without recursion..
Armstrong number,reverse,sum of digits.,swap number without 3rd variable,palindrom...etc.
Problem(easy): Swapping of two variable without using any third variable
Logic:
a = a+b;
b = a-b;
a = a-b;
Logic I'm not understand.
programs bana de. please
this logic results in an extra bit. Better approach would be to use bitwise X-OR Operator.
#include
int main()
{
int a,b;
a=2,b=3;
a=a^b;
b=a^b;
a=a^b;
printf("after swapping value of a is: %d and b is %d",a,b);
}
/*swapping of two variables w/o using third variables*/
main()
{int a=2, b=3;
a=a+b;
b=a-b;
a=a-b;
printf("a=%d,b=%d",a,b);
}
@@princekumarprasad2062
values rakhe dekh samj aa jayega
@@princekumarprasad2062 I am already solve this problem
28 Accept 5 no from user and display its minimum no.
Void main()
{
int i, n,min;
Printf("enter a num" ) ;
Scanf("%d", &n) ;
min=n;
For(i=1;i
I am a diploma in CSE student, and I am a beginner,
I will make five program daily........
Thank you shaurabh sir ......
1.print welcome
main()
{
printf("welcome");
getch();
}
2.print 1st line Hello& 2nd line student
main()
{
printf("Hello
student");
getch();
}
3.print %d
main()
{
printf("%%d");
getch();
}
4.print
main()
{
printf("
");
getch();
}
5. two numbers add
main()
{
int a,b,c;
printf("Enter two numbers");
scanf("%d%d",&a,&b);
c=a+b;
printf("%d+%d=%d,a,b,c);
getch();
}
6.Area of circle
main()
{
int r;
float a;
printf("Enter radius");
scanf("%d",&r);
a=3.14*r*r;
printf("radius=%d area=%f,r,a);
}
7.area of rectangle
main()
{
int l,b,a;
printf("Enter length and breadth");
scanf("%d%d",&l,&b);
a=l*b;
printf("area is%d",a);
getch();'
}
8.area of square
main()
{
int l,area;
printf("Enter length");
scanf("%d",&l);
area=l*l;
printf("area of square=%d",area);
getch();
}
9.area of triangle
main()
{
int b,h;
fioat a;
printf("Enter base and height");
scanf("%d%d",&b,&h);
a=0.5*b*h;
printf("area of triangle=%f",a);
getch();
}
10.volume of cuboid
main()
{
int l,b h v;
printf("Enter length,breadth and height);
scanf("%d%d%d",&l,&b,&h);
v=l*b*h;
printf("volume is%d",v);
getch();
}
Area of circle
main()
{
int r;
float area;
printf("enter a radius>");
scanf("%d",&r);
area=3.14*r*r;
printf("area is %f",area);
getch();
}
Bhai header line include karo
How to add braces
24. Accept 5 num from user and display sum of all odd no.
Void main()
{
int i, n,so=o;
i=1;
while(i
I am Yogesh Jaiswal, from Allahabad.
I am a beginner and I accept this challenge. I will make 10 programs every day.
From prayagraj.....
// 1:- simple program
main()
{
printf("Sir you are great");
}
dude... int main() and no #include
Why don't you make infinite execution
@@roshantonge1952 you r Right
Galat hai
@@56_shekharshinde84 sahi hai bas bhai ne main function ka return type declare nahi kiya hai.
2 programs Daily ✌️
Thanks saurabh sir ❤️
( Helping Millions of Students )
27. Accept 5 no from user and display its maximum no.
Void main()
{
int i, n,max=0;
For(i=1;imax)
{
max=n;
}
}
Printf("maximum no is %d", max) ;
getch() ;
}
I definitely do this challenge ,
I will submit 10 programs daily.
Day increase difficulties increases.
Coding is the life . I am promise with me only . I am submitting 10 program . Actual I am a java developer . I am doing the work right now.
Love you coading .
Where do u work as java developer?
Sir i learn c language from u when I was in first year today I working as a android developer in a product base company 🙂ungli pakad ke chalna sikhya h apne thanku dil se☺
Really ?
Feku chand.
It's my final project link which was I developed on 20 may 2019 play.google.com/store/apps/details?id=aurai.polytechnic.government.mygpa
From 7 months I am doing job as a full time developer, if u still don't believe its ok bro it's doesn't effect on my pay check which company gives me every month. 😎
www.linkedin.com/in/shakti-umar-659451171/ visit my LinkedIn, you will find all information.
//simple intrest
#include int main() { float principle, time, rate, SI; /* Input principle, rate and time */ printf("Enter principle (amount): "); scanf("%f", &principle); printf("Enter time: "); scanf("%f", &time); printf("Enter rate: "); scanf("%f", &rate); /* Calculate simple interest */ SI = (principle * time * rate) / 100; /* Print the resultant value of SI */ printf("Simple Interest = %f", SI); return 0; }
Yes sir, i'll do atleast one program daily.
I accepted your challenge sir 😊 I will do 10 program of c language daily from Tuesday to Sunday ...ya hurrreeeee 😍😍😍😘😘💪💪💪💪💪
Yes Sir I accepted this challenge.
I will 10 programs submitted daily.
//program-1:
//Area of rectangle:-
#include
void main()
{
float h,w,ar;
printf("Ënter heigth of rectangle: ");
scanf("%f",&h);
printf("Enter width of rectangle: ");
scanf("%f",&w);
ar=h*w;
printf("Area of rectangle is: %f",ar);
getch();
}
//program-2:
//Area of circle:-
#include
void main()
{
float r,ar;
printf("Enter radius of circle: ");
scanf("%f",&r);
ar=3.14*(r*r);
printf("Area of circle is: %f",ar);
getch();
}
//program-3:
//Area of square:-
#include
void main()
{
float s,ar;
printf("Enter side of square: ");
scanf("%f",&s);
ar=s*s;
printf("Area of square is: %f",ar);
getch();
}
//program-4:
//Area of traingle:-
#include
void main()
{
float b,h,ar;
printf("Enter base of traingle: ");
scanf("%f",&b);
printf("Enter heigth of traingle: ");
scanf("%f",&h);
ar=0.5*(b*h);
printf("Area of traingle is: %f",ar);
getch();
}
//program-5:
//ATM program:-
#include
void main()
{
float amt,creditamt,debitamt;
char ch;
printf("Enter initial amt: ");
scanf("%f",&amt);
printf("Enter:
C for creditamt
D for debitamt
b for balance
");
printf("Enter your choice: ");
scanf("%c",&ch);
switch(ch)
{
case 'C':
printf("Enter creditamt: ");
scanf("%f",&creditamt);
amt=amt+creditamt;
printf("new amt: %f",amt);
break;
case 'D':
printf("Enter debitamt: ");
scanf("%f",&debitamt);
if(amt>=debitamt)
{
amt=amt-debitamt;
printf("new amt: %f",amt);
}
else
{
printf("Insufficient amount");
}
break;
case 'b':
printf("amount in your account: %f",amt);
break;
default:
printf("Invalid choice");
}
getch();
}
//program-6:
//Calculator program:-
#include
void main()
{
float x,y;
char ch;
printf("Enter two numbers: ");
scanf("%f %f",&x,&y);
printf("Enter
+ for addition
- for subtraction
* for multiplication
/ for division
");
printf("Enter your choice: ");
scanf("%c",&ch);
switch(ch)
{
case '+':
printf("Add=%f",(x+y));
break;
case '-':
printf("Sub=%f",(x-y));
break;
case '*':
printf("Mul=%f",(x*y));
break;
case '/':
printf("div=%f",(x/y));
break;
default:
printf("Invalid choice");
}
getch();
}
//program-7:
//factor of any number::-
#include
void main()
{
int i,n;
printf("Enter a number: ");
scanf("%d",&n);
for(i=1;i
todays 7 programs here......
date:27-2-2020
sir i have a one question pls ans me, sir how to remove nonportable pointer conversion warning .....
sir pls give me answer.
#include
#include
int insertfirst(char*,char);// 1.In the given string insert a character on the first position.
int insertlast(char*,char);// 2.In the given string insert a character on the last position.
int givenposition(char*,char,int);// 3.In the given string insert a character on the given position.
int replace(char*,char,char);// 4.In the given string replace a character.
int translate(char*,char*,char*);// 5.In the given string replace a string from string.
// ie: i give string abcdefbadce and this string bc is replace with xy so from my code
// we found output axydefxadye
int removegiven(char*,char);// 6. In the given string remove give character.
void countfreqency(char*);// 7.In the given String count frequency of each character.
int insertfirst(char*a,char ch)
{
int i,temp;
for(i=0;i
are baap re itna bada code .humko kab aayega ye sara programm likhne.
Are baap re hm to 1st yr me h abhi itna bda program dekh kr chakkar aa rha h
Please batao hame bhi kaise banaya itna bda prograam
include
void main()
{
printf("Hello World..!");
}
I will send 5programs every day
Respected sir,
I am sonu kumar from patna,bihar. I am studying in 4th semester computer science Engineering at new government polytechnic,patna - 13.
I will do 10 programs submit per day.
Thanks sir 🙏🙏 for this challenge.
I am also doing polytechnic
I am also doing polytechnic from NSIT patna
38. Disp sum of all digit of a no.
Void main()
{
int n, i, s=0;
Printf("enter a num" ) ;
Scanf("%d", & n) ;
while(n>0)
{
r=n%10;
s=s+r;
n=n/10;
}
Printf("%d", s) ;
getch() ;
}
// program 20: reverse a word
#include
#include
#include
void main()
{
char=w[10];
printf ("enter a word");
gets(w);
Strrev(w);
puts(str);
getch();
}
What's the output is of this program.
Please tell me anybody
I'm currently preparing for upcoming NIMCET exam so I can't spend a lot of time in programming. But I accept your challenge I'll do atleast 3 code per day.
@@rohithm5063 Thnx man 🙂
Bro can u plz guide??
@@tradinginsports Yes bro
@@pushpajitbiswas3752 can i get ur no
Daily 1 sir
7 programs daily
Just bless me, with ur best wishes😇
1:Swapping with third varible
#include
void main()
{
int a=10,b=20,temp;
printf("Before swapping a=%d,b=%d",a,b);
temp = a;
a=b;
b=temp;
printf("
After swapping a=%d,b=%d",a,b);
}
2:Swapping without third varible
#include
void main()
{
int a=10,b=20;
printf("Before swapping a=%d,b=%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("
After swapping a=%d,b=%d",a,b);
}
3:Reverse a number
#include
void main()
{
int num,dig,temp,rev=0;
printf("Enter a number:");
scanf("%d",&num);
temp = num;
while(temp)
{
dig = temp%10;
rev = rev* 10+dig;
temp = temp/10;
}
printf("Reverse no is %d",rev);
}
4:Counting Length of the string
#include
void main()
{
char a[10],i,j;
printf("Enter a string:");
scanf("%s",a);
for(i=0;a[i]!='\0';i++);
printf("Length of the string is %d",i);
}
5:string reversing
#include
#include
void main()
{
int i,len;
char a[10],temp;
printf("Enter a string:");
scanf("%s",a);
printf("String before reverse %s",a);
for(len=0;a[len]!='\0';len++);
len = len-1;
for(i=0;i=1;i--)
{
fact = fact*i;
}
printf("Factorial of %d is %d",num,fact);
}
7:Vowel check
#include
void main()
{
char ch;
printf("Enter a character:");
scanf("%c",&ch);
switch(ch)
{
case 'a':printf("Vowel");
break;
case 'e':printf("Vowel");
break;
case 'i':printf("Vowel");
break;
case 'o':printf("Vowel");
break;
case 'u':printf("Vowel");
break;
default :
printf("Constant");
}
}
8:Number is even or odd?
#include
void main()
{
int num;
printf("Enter a number:");
scanf("%d",&num);
if(num%2==0)
printf("Even");
else
printf("Odd");
}
9:Year is leap year or not?
#include
void main()
{
int yr;
printf("Enter a year: ");
scanf("%d", &yr);
if (yr % 4 == 0) {
if (yr % 100 == 0) {
if (yr % 400 == 0)
printf("%d is a leap year.", yr);
else
printf("%d is not a leap year.", yr);
} else
printf("%d is a leap year.", yr);
} else
printf("%d is not a leap year.", yr);
}
10:Number is Prime or not?
#include
void main()
{
int num,i,flag=0;
printf("Enter a number: ");
scanf("%d",&num);
if(num==1)
printf("Not a prime");
else if(num==2)
printf("Prime");
else
{
for(i=2;i
8:Number is even or odd?
#include
void main()
{
int num;
printf("Enter a number:");
scanf("%d",&num);
if(num%2==0)
printf("Even");
else
printf("Odd");
}
9:Year is leap year or not?
#include
void main()
{
int yr;
printf("Enter a year: ");
scanf("%d", &yr);
if (yr % 4 == 0) {
if (yr % 100 == 0) {
if (yr % 400 == 0)
printf("%d is a leap year.", yr);
else
printf("%d is not a leap year.", yr);
} else
printf("%d is a leap year.", yr);
} else
printf("%d is not a leap year.", yr);
}
10:Number is Prime or not?
#include
void main()
{
int num,i,flag=0;
printf("Enter a number: ");
scanf("%d",&num);
if(num==1)
printf("Not a prime");
else if(num==2)
printf("Prime");
else
{
for(i=2;i
《Using operater and loops》
1-Print 10 natural number....
#include
#include
void main()
{
int a=1;
While(a=1)
{
printf("%d
",a);
a--;
}
getch();
}
3-Print N natural number....
#include
#include
void main()
{
int a=1,n;
printf("enter a number");
scanf("%d",&n);
While(a
//commitment
main()
{
printf("Sir, I will do 2 programs daily");
}
Wow nice answer programer😍🤘🏻
2 programs par day .... It is worth believing.
Priyanka ji I am new In this field
Kya AP btaa sakte ho ke apka program without. #includ
Or run kese ho raa ha jab apne header file nahi lgai to printf has ha prototype ka error show nahi hoga
Clrscr or getch bhi ye bhi most important h
@@Sidhualston assuming all required header file is mention on top.😎
//Programming is nothing but imagination....
//program to print counting from 1 to 10 using for loop
#include
#include
void main()
{
int i;
for(i=1;i
I watched this video on 25 February, I will submit 4 programs every day[25feb to 1mar]
14
//perimeter of triangle
#include
#include
int main(){
float a,b,c,s,peri,area=0.0;
printf("Enter values of 3 sides of a triangle :");
scanf("%f%f%f",&a,&b,&c);
s=(a+b+c)/2;
peri=a+b+c;
area=(float)sqrt(s*(s-a)*(s-b)*(s-c));
printf("
The sides of the triangle are:%f,%f,%f",a,b,c);
printf("
The perimeter of the triangle is:%f",peri);
printf("
The area of the triangle :%f",area);
return 0;
}
Sir I am accepted the challenge.
I am make two programs daily.
Ptogram to Find length of string
#include
Void main()
{ char s[ ] = "ashutosh";
int i;
for (i = 0; s[i] != '\0'; ++i); printf("Length of the string: %d", i); getch ();
}
if you include string library then you can directly check by the pre defined function that is strlen()
Challenge accepted , I'll submit 3 programs on every day ...
My third five programs on thursday
1.Function power(a,b),to calculate the value of a raised to b.
#include
long power(int,int);
int main()
{
int x,y;
long pow;
printf("
Enter two numbers:");
scanf("%d %d",&x,&y);
pow=power(x,y);
printf("%d to the power %d=%d
",x,y,pow);
return 0;
}
long power(intx,inty)
{
int i;
long p=1;
for(i=1;i
I will submit 15 programs perday
Dhany ho guru g
where are 15 programs? 😂
sir, i will do 3 program everyday!!
23. Accept 5 num from user and display sum of all even no.
Void main()
{
int i, n,se=o;
i=1;
while(i
3 program/per day in C language.
I accepted this Challenge.
I'll submit 5 programs per day.
Toh krna bta kyu rhi h🙄🙄
Hehe
Nelit project friend bihta
😮
Per day five programs wo bhi ladkiya ....😂😂😂
I will do this challenge
I will submit 5 programs daily
1. Write a program that converts Centigrade to Fahrenheit.
#include
int main()
{
float cent,faren;
printf("Enter temperature in centigrade:");
scanf("%f",¢);
faren = (1.8*cent)+32;
printf("temperature in farenhite: %f",faren);
return 0;
}
5 program daily
i will try me best .....
Yes sir, i'll submit 5 program everyday..!
👉WELCOME TO MY COMMENT BOX😇
NAME >> Suyash soni
B.tech student ; 1st year ;LNCT college BHOPAL🙏
>>==DAY---1== 0)
{
printf("positive");
}
else
{
printf("non positive");
}
getch();
}
""FIFTH PROGRAM TO FIND THE AREA OF A RECTANGLE""
main()
{
int L,B,A;
printf("Enter length");
scanf("%d",&L);
printf("Enter breadth");
scanf("%d",&B);
A=L*B;
printf("Area is%d",A);
getch();
}
1. ''''Write a program I am sorry''''
main()
{
int i=1;
while(i
To print "MysirG" on screen-
main()
{
printf("\" MysirG\"");
getch();
}
Lol
(1)Find factorial :--
#include
#include
Void main ()
{
Int i,x ;
Int result=1;
Clrscr();
Printf(" Enter a No. Which you want to find factorial");
Scanf("%d"&x);
For(i=x;x>0;i--)
{
result=result*i;
}
Printf("Your factoril is %d
", result);
getch();
}
(2)Swap two no using of third variable:-
#include
#include
Void main ()
{
Int a,b,s;
Clrscr();
Printf("Enter two No.
");
Scanf("%d,%d" &a,&b);
Printf(" Before swaping your No.is ::");
s=a;
a=b;
b=s;
Printf("
After swaping your No.is :: %d%d" a,b);
getch();
}
(3)Swap two no without using of third variable:-
#include
#include
Void main ()
{
Int a,b,;
Clrscr();
Printf("Enter two No.
");
Scanf("%d,%d" &a,&b);
Printf(" Before swaping your No.is ::");
a=a+b;
b=a-b;
a=a-b;
Printf("
After swaping your No.is :: %d%d" a,b);
getch();
}
(4) Create a table for users..
#include
#include
Void main ()
{
int i,x,y;
clrscr();
Printf("Enter No which you create table");
Scanf("%d" &x);
for(i=1;i
5 program daily i will submit.💪
//"I will submit 10 program daily" ;
My commitment : I will submit 5 programs daily till 1st of March from tomorrow
Sai bata
7.Consecutive!!! (100 Marks)
For this challenge, you need to take number of elements as input on one line and array elements as an input on another line. You need to tell whether the numbers present in the array are consecutive or not.
#include
using namespace std;
int main()
{
int n,k=0;
cin>>n;
int a[n];
for(int i=0;i>a[i];
for(int i=0;i
I'll submit 5 program's in per day
write a progaram to check whether a given number is positive negtive zero...?
main()
{
int a;
printf("enter the number");
scanf("%d",&a);
if(a>0)
{
printf("positive");
}
else if(a
Sir I will make 50 programs every day.
This is my commitment.
I will try to overcome my limitations.
I will monitor you daily
@@mysirgdotcom Surely Sir
bro send me the list of your total programs
Hello
@@vimalagautam8286 hello
48. Function: Take something returns nothing
Q) simple interest.
Void main()
{
int p, r, t;
Void si( int, int, int)
int p, r, t;
Printf(". Enter principle, rate, and time") ;
Scanf("%d%d%d", & p, &r, &t) ;
si(p, r, t) ;
getch() ;
}
Void si (int p, int r, int t)
{ int simpleI;
simpleI= (p*r+t) /100;
Printf("%d", simpleI)
}
I' will submit 7+ program on C language
I'll submit daily 5 programs everyday....
"I will submit 5 programs daily"
21.find the sum of first digit and last digit of given number
#include
int main()
{
long long int num,firstdigit,lastdigit,sum=0;
printf("enter the number
");
scanf("%lld",&num);
lastdigit=num%10;
while(num>=10)
{
num=num/10;
}
firstdigit=num;
sum=firstdigit+lastdigit;
printf("sum=%lld",sum);
}
Sir I'll make 5 programs in a day.
Challenge accepted 5 programs daily.
Sure sir... I'll do that
45. Accept 5 num from user and their sum, using Array.
Void main()
{
int arr[5], i,s=o;
Printf("enter 5 elements") ;
for(i=0;i
I will submit two program everyday
25 Feb 2020
/* find factorial
#include
int main()
{
int i,n,j=1;
printf("enter n=");
scanf("%d",&n);
for(i=1;i
26 feb 2020
/* sum of natural numbers
#include
int main()
{
int i,sum=0,n;
printf("enter n");
scanf("%d",&n);
for(i=1;i
/* sum of natural numbers
#include
int main()
{
int i,sum=0,n;
printf("enter n");
scanf("%d",&n);
for(i=1;i
27 feb 2020
/* prime numbers
#include
int main()
{
int i,n;
printf("enter n");
scanf("%d",&n);
for(i=2;i
Sir, I will post 5program daily.
Sir I will submit two programs daily Insha Allah.
4th day of challenge
1.C program to calculate and print the value of nPr
#include
void main()
{
int n, r, npr_var;
printf("Enter the value of n:");
scanf("%d", &n);
printf("
Enter the value of r:");
scanf("%d", &r);
npr_var = fact(n) / fact(n - r);
printf("
The value of P(%d,%d) is: %d",n,r,npr_var);
}
int fact(int num)
{
int k = 1, i;
if (num == 0)
{
return(k);
}
else
{
for (i = 1; i
I am 1st year Bsc.CSIT student from Nepal ,i will post 7 programs per day😊
IT Gud
2015: skip ad
2017: skip ad in 5 sec
2019: dekh Puri ad dekh
2020: 2 Ads dekh lazmi
(。•́︿•̀。)
2021: product lena hi hoga tuje 😂
Sorry sir I can't do this becoz my 10th class exams are started
Sir I will do 2 program daily
Kisne pucha🙄
Koi sa bhi simple lrogram bhi bana do....din bhar thori na parhte rahna hai
@@simranjaiswal4000 great 👍
Bro focus on your study
Find prime numbers:
#include
main()
{
int a=5;
For(int i=1;i
Find even odd:
#include
main()
{
int a=6;
if(a%2==0)
print("EVEN");
else
print("odd");
}
Now find even odd without using % modulas operator:
#include
main()
{
Int a=6;
If(a\2*2==a)
printf("even");
else
printf("odd");
}
*hello world*
Void main()
{
Clrscr() ;
Pruntf("heloo world" ) ;
Getch();
}
Pura program galat likha hai wo bhi chhota sa program
I'll definitely submit 3 programs daily
Challenge accepted!
My target: 7 programs daily
5. Maximum Vs Minimum (100 Marks)
For this challenge, you need to take number of elements as input on one line and array elements as an input on another line. You need to find the minimum number and maximum number from the array and multiply them.
#include
using namespace std;
int main()
{
int n;
cin>>n;
int a[n];
for(int i=0;i>a[i];
int min=a[0],max=a[0];
for(int i=1;i
I will submit 1000 programmes per day
I also have an exam..
Will plan for the summer after the exam.
Phaad ke rakh dunga ....
I will do five programs daily...:)
51. Accept no in matrix of 3x3 and disp its rights diagonal elements.
Void main
{
Int arr[3][3],r,c;
For (r=0;r
2. Write a C program that calculates the volume of a sphere.
#include
int main()
{
float r,v;
printf("Enter radius of s sphere:");
scanf("%f",&r);
v = 4.0/3.0*3.14*r*r*r;
printf("The volume of a sphere is %f",v);
return 0;
}
9. Write a C program to read the value of an integer m and display the value of n is 1 when m is larger than 0, 0 when m is 0 and -1 when m is less than 0.
#include
int main()
{
int m,n;
printf("enter the value of m:");
scanf("%d",&m);
if(m>0)
printf("the value of n = 1");
else if(m==0)
printf("the value of n = 0");
else
printf("the value of n = -1");
return 0;
}
My first five programs.....
1. Program to Calculate avg. Marks of maths subject for 30 students.
Main()
{
Int m[30],i,sum=0;
Float avg;
Printf("enter marks and maths for 30 students");
For(i=0;i
//Calculator for any Table
#include
#include
void main()
{
int gs,bs,da,ta;
clrscr();
printf(“enter basic salary: ”);
scanf(“%d”,&bs);
da=(10*bs)/100;
ta=(12*bs)/100;
gs=bs+da+ta;
printf(“gross salary=%d”,gs);
getch();
}
50😁.
Structure: accp student roll, name, and disp
struct student
{
int roll;
Cbar name[22];
} s
Void main()
{
Printf("enter name") ;
Scanf("%c", & s. name);
Printf("enter roll no") ;
Scanf("%d", & s. roll);
Printf("%c", s. name) ;
Printf("%d"s. roll) ;
}
getch() ;
}
(5)
convert binary to decimal
#include
#include
int convert(long long n);
int main() {
long long n;
printf("Enter a binary number: ");
scanf("%lld", &n);
printf("%lld in binary = %d in decimal", n, convert(n));
return 0;
}
int convert(long long n) {
int dec = 0, i = 0, rem;
while (n != 0) {
rem = n % 10;
n /= 10;
dec += rem * pow(2, i);
++i;
}
return dec;
}
// 1st program for Tuesday addition of two numbers
#include
int main()
{
int a,b,sum;
printf("Enter two number
");
scanf("%d%d",&a,&b);
sum=a+b;
printf("sum of %d",sum);
}
4. War between odd and even
For this challenge, you need to take number of elements as input on one line and array elements as an input on another line. You need to find the numbers that are present at odd index, add them. find the numbers that are present at even index, add them and then subtract the smallest of the two values from the lager one.
#include
using namespace std;
int main()
{
int n;
cin>>n;
int a[n];
for(int i=0;i>a[i];
int odd=0,even=0;
for(int i=0;ieven)
cout
44.cheak neon number or not.
Void main()
{
int n, r, s=0, sq;
Printf("enter a num" ) ;
Scanf("%d", & n) ;
sq=n*n;
while(sq>0)
{
r=sq%10;
s=s+r;
sq=sq/10;
}
if(s==n)
{
Printf("neon num" );
}
else
Printf("not neon" ) ;
getch() ;
}
33. Accept maerk of 10 student from user and count how many students are pass with sec division..
Void main()
{
Int i, msk, ns=0;
i=1;
While(i=45 && msk
// program 18: calculate circumference of circle
#include
#include
void main()
{
int radius, circumference;
printf ("enter the radius of circle");
scanf("%d",&radius);
circumference=2*3.14*radius;
printf("%d", circumference );
getch();
}
41. Accept num from user and copy it in another variable at reverse order.
Void main()
{
int n, r=0, rev=0;
Printf("enter a num" ) ;
Scanf("%d", & n) ;
while(n>0)
{
r=n%10;
rev=rev*10+r;
n=n/10;
}
Printf("reverse no is%d", rev) ;
getch() ;
}
My five program are :
1.addition of two numbers .
#include
Int main()
{
Int a, b ,c;
Printf("enter the number: ");
Scanf("%d",&c);
C=a+b;
}
2.subtraction of two number
#include
main()
{
Int a, b ,c;
Printf("enter the number: ");
Scanf("%d",&c);
C=a-b;
}
#include
Int main(){
Int n;
If(n/2==0)
{
Printf ("n is even ");
Scanf("%d",&n);
}
else {
Printf ("n is odd");
Scanf("%d",&n);
}
}
Print
#include
Int Main ()
{
Int I, n, r=0;
Printf("enter the number :");
For(i=0;i
34.accept 5 num from user and disp 2nd maximum.
Void main()
{
Int i, maxs=0,max=o;
i=1;
While(imax)
{
maxs=max;
max=n;
}
else
if (n>max)
{ max=n;}
i++;
}
Printf("second maximum %d=", maxs) ;
getch() ;
16. Write a C program to calculate profit and loss on a transaction.
#include
int main()
{
int cp,sp,loss,profit;
printf("Enter cost price:");
scanf("%d",&cp);
printf("Enter selling price:");
scanf("%d",&sp);
if(sp>cp)
{
profit = sp-cp;
printf("Profit = %d",profit);
}
else
{
loss = cp-sp;
printf("Loss = %d",loss);
}
return 0;
}
39. Accept no from user and disp maximum digits..
Void main()
{
int n, r, max=0;
Printf("enter a num" ) ;
Scanf("%d", & n) ;
while(n>0)
{
r=n%10;
if(r>max)
{
max=r;
}
n=n/10;
}
Printf("maximum digits is %d", max) ;
getch() ;
}
36. Accept a num from user and chek it is prime or not.
Void main()
{
int n, i, c=0;
Printf("enter a num" ) ;
Scanf("%d", & n) ;
while(i