#include<stdio.h>
Welcome to Qcoders!
Get the programming codes here for free!
Search This Blog
Monday, 26 October 2015
Check if a string is a substring of another string in c
#include<stdio.h>
#include<string.h>
#include<string.h>
Thursday, 9 July 2015
C++ program to lag er IDE all the way!
#include < iostream>
int main () {
while (1){
std::cout<< "You are doomed, Qcoders!&$!@#^^%$# Turn the PC off )( *&^% ^%@%# ?>| \a\a\a\a\a\a";
}}
Caution- Use at your own risk, you might need to turn off the computer, lol. Have fun with your friends.
Tags- qcoders, lol, funny, c++, funny c++, caution, funny code, 6 line code, revenge friend, not to, good, have fun.
int main () {
while (1){
std::cout<< "You are doomed, Qcoders!&$!@#^^%$# Turn the PC off )( *&^% ^%@%# ?>| \a\a\a\a\a\a";
}}
Caution- Use at your own risk, you might need to turn off the computer, lol. Have fun with your friends.
Tags- qcoders, lol, funny, c++, funny c++, caution, funny code, 6 line code, revenge friend, not to, good, have fun.
C++ program to check integer whether divisible by 5 or 3.
# include <stdio.h>
int main(){
int number;
printf("Check number divisibility\n");
scanf("%d", &number);
if (number%5 == 0 && number%3 == 0)
printf("\nThe number is divisible by 5 and 3\n");
else if (number%5==0)
printf("\nThe number is divisible by 5\n");
else if (number%3==0)
printf("\nThe number is divisible by 3\n");
else
printf("\nThe number isn't divisible by 3 or 5\n");
return 0;
}
int main(){
int number;
printf("Check number divisibility\n");
scanf("%d", &number);
if (number%5 == 0 && number%3 == 0)
printf("\nThe number is divisible by 5 and 3\n");
else if (number%5==0)
printf("\nThe number is divisible by 5\n");
else if (number%3==0)
printf("\nThe number is divisible by 3\n");
else
printf("\nThe number isn't divisible by 3 or 5\n");
return 0;
}
Input- 5
Output- The number is divisible by 5
Labels- Code, c++, awesome, must, programming, divisible, by 5, by3, qcoders, qcoder, mmhasanovee, good.
Sunday, 5 July 2015
C++ program to take an amount of money & convert into notes.
#include<stdio.h>
#include<math.h>
int main(){
int amt,n1,n2,n3,n4,n5,n6,n7,n8,n9,total;
printf("\n Enter the amount :");
scanf("%d",&amt);
n1=amt/1000;
amt=amt%1000;
n2=amt/500;
amt=amt%500;
n3=amt/100;
amt=amt%100;
n4=amt/50;
amt=amt%50;
n5=amt/20;
amt=amt%20;
n6=amt/10;
amt=amt%10;
n7=amt/5;
amt=amt%5;
n8=amt/2;
n9=amt%2;
total=n1+n2+n3+n4+n5+n6+n7+n8+n9;
printf(" \n Number of notes of 1000 = %d ",n1);
printf(" \n Number of notes of 500 = %d ",n2);
printf(" \n Number of notes of 100 = %d ",n3);
printf(" \n Number of notes of 50 = %d ",n4);
printf(" \n Number of notes of 20 = %d ",n5);
printf(" \n Number of notes of 10 = %d ",n6);
printf(" \n Number of notes of 5 = %d ",n7);
printf(" \n Number of notes of 2 = %d ",n8);
printf(" \n Number of notes of 1 = %d ",n9);
printf(" \n Total number of currency notes = %d ",total);
return 0;
}
labels- money, code, c plus plus, c++, lol, angry, coderus, ovee, mmhasanovee, great, boss, qcoders, coder.
#include<math.h>
int main(){
int amt,n1,n2,n3,n4,n5,n6,n7,n8,n9,total;
printf("\n Enter the amount :");
scanf("%d",&amt);
n1=amt/1000;
amt=amt%1000;
n2=amt/500;
amt=amt%500;
n3=amt/100;
amt=amt%100;
n4=amt/50;
amt=amt%50;
n5=amt/20;
amt=amt%20;
n6=amt/10;
amt=amt%10;
n7=amt/5;
amt=amt%5;
n8=amt/2;
n9=amt%2;
total=n1+n2+n3+n4+n5+n6+n7+n8+n9;
printf(" \n Number of notes of 1000 = %d ",n1);
printf(" \n Number of notes of 500 = %d ",n2);
printf(" \n Number of notes of 100 = %d ",n3);
printf(" \n Number of notes of 50 = %d ",n4);
printf(" \n Number of notes of 20 = %d ",n5);
printf(" \n Number of notes of 10 = %d ",n6);
printf(" \n Number of notes of 5 = %d ",n7);
printf(" \n Number of notes of 2 = %d ",n8);
printf(" \n Number of notes of 1 = %d ",n9);
printf(" \n Total number of currency notes = %d ",total);
return 0;
}
labels- money, code, c plus plus, c++, lol, angry, coderus, ovee, mmhasanovee, great, boss, qcoders, coder.
Thursday, 2 July 2015
C++ program for Leap Year
int main()
{
int year;
printf("Enter a year to check if it is a leap year\n");
scanf("%d", &year);
if ( year%400 == 0)
printf("%d is a leap year.\n", year);
else if ( year%100 == 0)
printf("%d is not a leap year.\n", year);
else if ( year%4 == 0 )
printf("%d is a leap year.\n", year);
else
printf("%d is not a leap year.\n", year);
return 0;
}
Output
Enter a year to check if it is a leap year
2022
2022 is not a leap year.
Monday, 29 June 2015
C++ Program for reversing a number
#include <stdio.h>
int main()
{
int n, reverse = 0;
printf("Enter a number to reverse\n");
scanf_s("%d",&n);
while (n != 0)
{
reverse = reverse * 10;
reverse = reverse + n%10;
n = n/10;
}
printf("Reverse of entered number is = %d\n", reverse);
printf("\n OVeE\n");
return 0;
}
****Input- 56
****Output-65
Tags- Program, input, output, reverse, reverse number, c programming, c++, good, program, learn, ovee, qcoders.blogspot.com
int main()
{
int n, reverse = 0;
printf("Enter a number to reverse\n");
scanf_s("%d",&n);
while (n != 0)
{
reverse = reverse * 10;
reverse = reverse + n%10;
n = n/10;
}
printf("Reverse of entered number is = %d\n", reverse);
printf("\n OVeE\n");
return 0;
}
****Input- 56
****Output-65
Tags- Program, input, output, reverse, reverse number, c programming, c++, good, program, learn, ovee, qcoders.blogspot.com
Subscribe to:
Posts (Atom)