This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int i, p = 0, n = 0, o = 0, a; | |
// p--> positive , n---> negative ,o---> zero ; | |
int wish; // y=1(yess) , n=0(no) | |
for (i = 1; i >= 1; i++) | |
{ | |
printf("enter your wish to enter a number or not(y=1,n=0) ="); | |
scanf("%d", &wish); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int match_stick = 21, user_choice, computer_choice; | |
printf("total number of match stick=%d\n", match_stick); | |
while (match_stick >= 1) | |
{ | |
printf("enter your chioce (1, 2,3 or 4)="); | |
scanf("%d",& user_choice); | |
if (user_choice > 4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int p, nohw, how, owm; | |
//nohw=no of hour worked , how=hour over worked | |
//owm= over time worked money | |
for (p = 1; p <= 10; p++) | |
{ | |
printf("enter you hour worked="); | |
scanf("%d", &nohw); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int a, num, facto = 1; | |
printf("please type any number="); | |
scanf("%d", &num); | |
for (a = 1; a <= num; a++) | |
{ | |
facto = facto * a; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int a, b, c, pow = 1; | |
printf("enter the value of a, b"); | |
scanf("%d%d", &a, &b); | |
for (c = 1; c <= b; c++) | |
{ | |
pow = pow * a; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int a = 0; | |
while (a <= 225) | |
{ | |
printf("ASCII value of %d is=%c\n", a, a); | |
a++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//𝙢𝙚𝙩𝙝𝙤𝙙 1 | |
#include <stdio.h> | |
#include<math.h> | |
int main() | |
{ | |
int num, d1, d2, d3, sum, num2; | |
//d1 d2 d2 is first,second ,third digit of num | |
// eg num=34 then d1=0 d2=3 ,d3=4 | |
for (num = 1; num <= 500; num++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int curentYear, baseYear, leapYear, no_leapYear, totalNo_ofDay, year, di; | |
printf("enter current year="); | |
scanf("%d", &curentYear); | |
baseYear = 1900; | |
year = (curentYear - 1) - baseYear; | |
leapYear = (year / 4); //because 1900 is not leap year |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int year; | |
printf("Enter year :"); | |
scanf("%d", &year); | |
if ((year % 4) == 0) | |
{ | |
if ((year % 100) == 0) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
char ch; | |
int ASCII; | |
printf("enter a charcter :"); | |
scanf("%c", &ch); | |
ASCII = ch; | |
if (ASCII >= 65 && ASCII <= 90) |
OlderNewer