Beruflich Dokumente
Kultur Dokumente
#include<stdio.h>
int main(){
int num = 1;
print(num);
return 0;
}
int print(num){
if(num<=100){
printf("%d ",num);
print(num+1);
}
}
#include<stdio.h>
int main(){
int a,b;
int sum;
//sum = a - (-b);
sum = a - ~b -1; // ~b= -b+1
return 0;
}
#include<stdio.h>
int main()
{
int i;
for(i=0;i<=255;i++)
printf("ASCII value of character %c: %d\n",i,i);
return 0;
}
4. Determine the frequency of each element in an array of sorted elements.
Example: Input: 1, 1, 4, 4, 5, 6, 7, 7, 7
Output: 1 -> 2
4 -> 2
5 -> 1
6 -> 1
7 -> 3
#include <stdio.h>
int main()
{
int arr[10], F[10], i, j, Count, N;
if(arr[i]==arr[j])
{
ind=j;
ele=arr[i];
}
}}
if(ind!=-1)
printf("%d repeated at index %d\n",ele,ind);
else
printf("There is no repeated element\n");
11. which reads a square matrix a[n][n] and print only the elements that falls in the diagonal
starting from a[0][0] to a[n][n] and all other elements printed as 0 (zero).
12. which computes and prints the sum of each rows of a 2D Matrix.
13. C program to count frequency of each element of an array
14. find number of blank space in a sentence
15. C program to count total number of vowel or consonant in a string
17.
Answer: Garbage