Share Post:
This program will read your IP from system and then prints it on the screen.
#include<stdio.h>
#include<stdlib.h>
int main()
{
system("C:\\Windows\\System32\\ipconfig");
return 0;
}
Showing posts with label c program. Show all posts
Showing posts with label c program. Show all posts
Friday, March 28, 2014
Monday, March 17, 2014
Find Maximum Element In Array
#include <stdio.h>
#include <conio.h>
int main()
{
int array[100], max, size, i, loc = 1;
printf("Input number of elements in array\n");
scanf("%d", &size);
#include <conio.h>
int main()
{
int array[100], max, size, i, loc = 1;
printf("Input number of elements in array\n");
scanf("%d", &size);
Labels:
Array's maximum element,
c program
Sunday, March 16, 2014
Check Anagram in C
#include <stdio.h>
#include<conio.h>
int check_anagram(char [], char []);
int main()
{
char s1[110], s2[110];
int cond;
printf("Enter first string\n");
gets(s1);
printf("Enter second string\n");
gets(s2);
#include<conio.h>
int check_anagram(char [], char []);
int main()
{
char s1[110], s2[110];
int cond;
printf("Enter first string\n");
gets(s1);
printf("Enter second string\n");
gets(s2);
Labels:
Anagram in c,
c program
Thursday, March 13, 2014
C program in order to reverse a number
This program reverses the number given as input by the user. Eg. if user enters 123 the output will be 321.
By Siddique Hassan.
#include <stdio.h>
#include<conio.h>
int main()
{
int n, reverse = 0;
printf("Enter a number to reverse\n");
scanf("%d",&n);
By Siddique Hassan.
#include <stdio.h>
#include<conio.h>
int main()
{
int n, reverse = 0;
printf("Enter a number to reverse\n");
scanf("%d",&n);
Labels:
c program,
reverse number program
Sunday, March 9, 2014
C program to concatenate strings without strcat(function)
#include <stdio.h>
#include<conio.h>
void concatenate_string(char*, char*);
int main()
{
char original[100], add[100];
printf("Enter source string\n");
gets(original);
#include<conio.h>
void concatenate_string(char*, char*);
int main()
{
char original[100], add[100];
printf("Enter source string\n");
gets(original);
Labels:
c program,
String concatenation
C program to print Pascal triangle
#include <stdio.h>
#include<conio.h>
long factorial(int);
int main()
{
int i, n, c;
printf("Enter the number of rows you wish to see in pascal triangle\n");
scanf("%d",&n);
#include<conio.h>
long factorial(int);
int main()
{
int i, n, c;
printf("Enter the number of rows you wish to see in pascal triangle\n");
scanf("%d",&n);
Labels:
c program,
Pascal triangle
Saturday, March 8, 2014
C program to find either the entered alphabet is vowel or not
#include <stdio.h>
#include<conio.h>
int main()
{
char ch;
printf("Enter a character\n");
scanf("%c", &ch);
#include<conio.h>
int main()
{
char ch;
printf("Enter a character\n");
scanf("%c", &ch);
Labels:
c program,
vowel finder
C program to check leap year
C program to find whether the year entered by user is a leap year or not.
#include <stdio.h>
#include<conio.h>
int main()
{
int year;
printf("Enter a year to check if it is a leap year\n");
scanf("%d", &year);
#include <stdio.h>
#include<conio.h>
int main()
{
int year;
printf("Enter a year to check if it is a leap year\n");
scanf("%d", &year);
Labels:
c program,
check leap year
C program to print Floyd's triangle.
This program prints Floyd's triangle. Number of rows of Floyd's triangle to print is entered by the user. First four rows of Floyd's triangle are as follows :-
1
2 3
4 5 6
7 8 9 10
#include <stdio.h>
#include<conio.h>
int main()
{
int n, i, c, a = 1;
1
2 3
4 5 6
7 8 9 10
#include <stdio.h>
#include<conio.h>
int main()
{
int n, i, c, a = 1;
Labels:
c program,
print Floyd's triangle
Friday, March 7, 2014
C program to print Fibonacci series
In Fibonacci series, except first two terms in sequence every other term is the sum of two previous terms, For example 8 = 3 + 5 (addition of 3, 5). This sequence has many applications in mathematics and Computer Science.
#include<stdio.h>
#include<conio.h>
int main()
{
int n, first = 0, second = 1, next, c;
printf("Enter the number of terms\n");
scanf("%d",&n);
#include<stdio.h>
#include<conio.h>
int main()
{
int n, first = 0, second = 1, next, c;
printf("Enter the number of terms\n");
scanf("%d",&n);
Labels:
c program,
Fibonacci series program
Thursday, March 6, 2014
C program to find armstrong number
A number is armstrong if the sum of cubes of individual digits of a number is equal to the number itself. For example 371 is an armstrong number as 3^3 + 7^3 + 1^3 = 371.
#include <stdio.h> //header file
#include<conio.h> //header file
int main()
{ //start of main body
int number, sum = 0, temp, remainder;
#include <stdio.h> //header file
#include<conio.h> //header file
int main()
{ //start of main body
int number, sum = 0, temp, remainder;
Labels:
c program,
c program armstrong number
Wednesday, March 5, 2014
Basic C program to print sum of squares of 4 numbers
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b,c,d,sumsq;
printf("\nEnter 1st number...");
scanf("%d",&a);
printf("\nEnter 2nd number...");
#include <stdlib.h>
int main()
{
int a,b,c,d,sumsq;
printf("\nEnter 1st number...");
scanf("%d",&a);
printf("\nEnter 2nd number...");
Labels:
c program,
program sum of squares
C program to find a palindrome number
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n,revers=0,temp;
printf("Enter the number...");
scanf("%d",&n);
#include <stdlib.h>
int main()
{
int n,revers=0,temp;
printf("Enter the number...");
scanf("%d",&n);
Labels:
c program,
palindrome number program
C program to reverse a number
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a,num;
printf("enter
the 2-digit number");
Labels:
c program,
reverse number program
Subscribe to:
Posts (Atom)