Important C programs asked in interviews :-
1. C program to print hello world without using semicolon
#include<stdio.h>
void main()
{
if(printf("Hello world"))
{
}
}
2. Program to convert string into ASCII values in c programming language:
#include<stdio.h>
int main(){
char str[100];
int i=0;
printf("Enter any string: ");
scanf("%s",str);
printf("ASCII values of each characters of given string: ");
while(str[i])
printf("%d ",str[i++]);
return 0;
}
No comments:
Post a Comment