This file contains hidden or 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 ctr = 1;//counter | |
int sum = 0;//summary | |
while(ctr != 0) { | |
printf("Enter an integer: "); | |
scanf("%d",&ctr); |
This file contains hidden or 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 x; | |
printf("Enter a one digit integer: "); | |
scanf("%d",&x); | |
switch(x) | |
{ |
This file contains hidden or 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(void) | |
{ | |
unsigned int passes = 0; | |
unsigned int failures = 0; | |
unsigned int student = 1; | |
int result; | |
while(student <= 10) { | |
printf("%s","Enter result (1=pass,2=fail): "); |
This file contains hidden or 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 x,y; | |
printf("Enter two integers: "); | |
scanf("%d %d",&x,&y); | |
if(x % y == 0) { | |
printf("First integer is a multiple of the second.\n"); |
This file contains hidden or 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 x; | |
printf("Enter an integer: "); | |
scanf("%d",&x); | |
if(x % 2 == 0) { | |
printf("This number is even.\n"); |
This file contains hidden or 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(void) | |
{ | |
unsigned int counter; | |
int grade; | |
int total; | |
int average; | |
//initialization phase |
This file contains hidden or 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(void) | |
{ | |
int num1; | |
int num2; | |
printf("Enter two integers, and I will tell you\n"); | |
printf("the relationships they satisfy: "); | |
This file contains hidden or 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(void) | |
{ | |
int integer1; | |
int integer2; | |
int sum; | |
int product; | |
This file contains hidden or 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 array1(int a[],int n) | |
{ | |
int *p,sum=0,counter; | |
p=&a[0]; | |
for(counter=0;counter<n;counter++) | |
sum+=*(p+counter); | |
return sum; |
This file contains hidden or 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> | |
#include<conio.h> | |
int main() | |
{ | |
int val[8] = {25,69,83,23,96,13,41,90}; | |
for(int i = 0; i <= 7; i++) | |
{ | |
printf("\nval[%d]: value %d and address %p",i,val[i],&val[i]); |
NewerOlder